Merge remote-tracking branch 'origin/master'
# Conflicts: # mes/hd/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/CacheLineHandServiceImpl.java
This commit is contained in:
@@ -2,6 +2,13 @@ package org.nl.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
@@ -13,28 +20,28 @@ import lombok.Getter;
|
||||
public enum AcsTaskEnum {
|
||||
UNDEFINED("0","未定义类型"),
|
||||
//任务类型:3个点,任务编号,无需载具
|
||||
PRODUCT_MAC("1","专机-专机任务"),
|
||||
TASK_PRODUCT_MAC("1","专机-专机任务"),
|
||||
//3个点,任务编号,缓存线空载具列表
|
||||
PRODUCT_CACHE("2","专机-缓存线任务"),
|
||||
TASK_PRODUCT_CACHE("2","专机-缓存线任务"),
|
||||
//3个点,任务编号,缓存线满料载具列表
|
||||
CACHELINE_OUT("3","缓存线出库任务"),
|
||||
TASK_CACHELINE_OUT("3","缓存线出库任务"),
|
||||
|
||||
//回调状态
|
||||
ACS_RUNDING("1","运行中"),
|
||||
ACS_FINISH("2","完成"),
|
||||
ACS_CANNEL("3","完成"),
|
||||
STATUS_START("1","开始取货"),
|
||||
STATUS_RUNDING("2","放货中"),
|
||||
STATUS_FINISH("3","完成"),
|
||||
STATUS_CANNEL("4","取消"),
|
||||
|
||||
ACS_CALLTYPE_FULL("1","满料请求"),
|
||||
ACS_CALLTYPE_EMP("2","缺料请求"),
|
||||
REQUEST_CALLTYPE_FULL("1","满料请求"),
|
||||
REQUEST_CALLTYPE_EMP("2","缺料请求"),
|
||||
;
|
||||
private String code;
|
||||
private String desc;
|
||||
|
||||
public static AcsTaskEnum getType(String type){
|
||||
for (AcsTaskEnum value : AcsTaskEnum.values()) {
|
||||
if (value.getCode().equals(type)){
|
||||
return value;
|
||||
}
|
||||
public static AcsTaskEnum getType(String type,String enumType){
|
||||
Optional<AcsTaskEnum> first = Arrays.stream(AcsTaskEnum.values()).filter(a -> a.name().contains(enumType.toUpperCase(Locale.ROOT)) && a.getCode().equals(type)).findFirst();
|
||||
if (first.isPresent()){
|
||||
return first.get();
|
||||
}
|
||||
return AcsTaskEnum.UNDEFINED;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class CachelinePositionDto implements Serializable {
|
||||
private BigDecimal positionOrder_no;
|
||||
|
||||
/** 缓存线编码 */
|
||||
private String cacheLine_code;
|
||||
private String cacheline_code;
|
||||
|
||||
/** 缓存线层数 */
|
||||
private BigDecimal layer_num;
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.nl.wms.cacheline.region.rest;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.wms.cacheline.region.service.CachelineRegionRelationService;
|
||||
import org.nl.wms.cacheline.region.service.dto.CachelineRegionRelationDto;
|
||||
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 java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2023-03-24
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "个缓存线区域关系管理")
|
||||
@RequestMapping("/api/cachelineRegionRelation")
|
||||
@Slf4j
|
||||
public class CachelineRegionRelationController {
|
||||
|
||||
private final CachelineRegionRelationService cachelineRegionRelationService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询个缓存线区域关系")
|
||||
@ApiOperation("查询个缓存线区域关系")
|
||||
//@PreAuthorize("@el.check('cachelineRegionRelation:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(cachelineRegionRelationService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增个缓存线区域关系")
|
||||
@ApiOperation("新增个缓存线区域关系")
|
||||
//@PreAuthorize("@el.check('cachelineRegionRelation:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody CachelineRegionRelationDto dto){
|
||||
cachelineRegionRelationService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改个缓存线区域关系")
|
||||
@ApiOperation("修改个缓存线区域关系")
|
||||
//@PreAuthorize("@el.check('cachelineRegionRelation:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody CachelineRegionRelationDto dto){
|
||||
cachelineRegionRelationService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除个缓存线区域关系")
|
||||
@ApiOperation("删除个缓存线区域关系")
|
||||
//@PreAuthorize("@el.check('cachelineRegionRelation:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
cachelineRegionRelationService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.nl.wms.cacheline.region.service;
|
||||
|
||||
import org.nl.wms.cacheline.region.service.dto.CachelineRegionRelationDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author lyd
|
||||
* @date 2023-03-24
|
||||
**/
|
||||
public interface CachelineRegionRelationService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<CachelineRegionRelationDto>
|
||||
*/
|
||||
List<CachelineRegionRelationDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param relation_id ID
|
||||
* @return CachelineRegionRelation
|
||||
*/
|
||||
CachelineRegionRelationDto findById(String relation_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return CachelineRegionRelation
|
||||
*/
|
||||
CachelineRegionRelationDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(CachelineRegionRelationDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(CachelineRegionRelationDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package org.nl.wms.cacheline.region.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @description /
|
||||
* @date 2023-03-24
|
||||
**/
|
||||
@Data
|
||||
public class CachelineRegionRelationDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
private String relation_id;
|
||||
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String region_code;
|
||||
|
||||
/**
|
||||
* 缓存线编码
|
||||
*/
|
||||
private String cacheline_code;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private String is_active;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package org.nl.wms.cacheline.region.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
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.nl.wms.cacheline.region.service.CachelineRegionRelationService;
|
||||
import org.nl.wms.cacheline.region.service.dto.CachelineRegionRelationDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2023-03-24
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CachelineRegionRelationServiceImpl implements CachelineRegionRelationService {
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(Map whereJson, Pageable page){
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
String where = "1 = 1";
|
||||
if (ObjectUtil.isNotEmpty(whereJson.get("search"))){
|
||||
String search = whereJson.get("search").toString();
|
||||
where = "region_code like '%" + search + "%' " +
|
||||
"OR cacheline_code like '%" + search + "%'";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where, "region_code, cacheline_code");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CachelineRegionRelationDto> queryAll(Map whereJson){
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(CachelineRegionRelationDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CachelineRegionRelationDto findById(String relation_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONObject json = wo.query("relation_id = '" + relation_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CachelineRegionRelationDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CachelineRegionRelationDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CachelineRegionRelationDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(CachelineRegionRelationDto dto) {
|
||||
dto.setRelation_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(CachelineRegionRelationDto dto) {
|
||||
CachelineRegionRelationDto entity = this.findById(dto.getRelation_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_cacheline_region_relation");
|
||||
for (String relation_id: ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("relation_id", String.valueOf(relation_id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", DateUtil.now());
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,9 +44,9 @@ public class AcsToWmsController {
|
||||
return new ResponseEntity<>(acsToWmsService.receiveTaskStatusAcs(string), HttpStatus.OK);
|
||||
}
|
||||
|
||||
// @PostMapping("/orderFinish")
|
||||
// @Log("ACS给WMS下发工单完成状态")
|
||||
// @ApiOperation("ACS给WMS下发工单完成状态")
|
||||
@PostMapping("/orderFinish")
|
||||
@Log("ACS给WMS下发工单完成状态")
|
||||
@ApiOperation("ACS给WMS下发工单完成状态")
|
||||
public ResponseEntity<Object> orderFinish(@RequestBody String string) {
|
||||
return new ResponseEntity<>(acsToWmsService.orderFinish(string), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -38,14 +38,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
@Override
|
||||
public Map<String, Object> apply(JSONObject jsonObject) {
|
||||
Map result = MapOf.of("status", HttpStatus.OK.value(), "message", "ACS向WMS申请任务成功!");
|
||||
//1.满料请求
|
||||
//2.缺料请求
|
||||
//1.专机设备满料请求
|
||||
//2.专机设备缺料请求:专机,深坑
|
||||
String type = jsonObject.getString("type");
|
||||
try {
|
||||
if (type.equals(AcsTaskEnum.ACS_CALLTYPE_FULL.getCode())){
|
||||
if (type.equals(AcsTaskEnum.REQUEST_CALLTYPE_FULL.getCode())){
|
||||
agvInstService.fullMaster(jsonObject);
|
||||
}
|
||||
if (type.equals(AcsTaskEnum.ACS_CALLTYPE_EMP.getCode())){
|
||||
if (type.equals(AcsTaskEnum.REQUEST_CALLTYPE_EMP.getCode())){
|
||||
agvInstService.callMatter(jsonObject);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
@@ -78,10 +78,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String message = "";
|
||||
String status = "";
|
||||
if ("1".equals(acs_task_status)) {
|
||||
status = AcsTaskEnum.ACS_RUNDING.getCode();
|
||||
status = AcsTaskEnum.STATUS_RUNDING.getCode();
|
||||
}
|
||||
if ("2".equals(acs_task_status)) {
|
||||
status = AcsTaskEnum.ACS_FINISH.getCode();
|
||||
status = AcsTaskEnum.STATUS_FINISH.getCode();
|
||||
}
|
||||
// 任务处理类
|
||||
try {
|
||||
|
||||
@@ -1,34 +1,21 @@
|
||||
package org.nl.wms.ext.acs.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.ConstantParam;
|
||||
import org.nl.common.enums.AcsTaskEnum;
|
||||
import org.nl.common.enums.InterfaceLogType;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.service.RedisService;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.exception.WDKException;
|
||||
import org.nl.utils.PointLockUtils;
|
||||
import org.nl.wms.sch.tasks.PointToPointTask;
|
||||
import org.nl.wms.sch.tasks.SpeMachineryTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/*
|
||||
@@ -68,7 +55,7 @@ public class AgvInstService {
|
||||
String needMove = order.getString("is_needmove");
|
||||
String materialprocessSeries = order.getString("materialprocess_series");
|
||||
|
||||
String taskType = AcsTaskEnum.PRODUCT_MAC.getCode();
|
||||
String taskType = AcsTaskEnum.TASK_PRODUCT_MAC.getCode();
|
||||
if (StatusEnum.STATUS_TRUE.equals(needMove)){
|
||||
JSONObject devicePoint = basePoint.query("point_code = '" + point_code + "' and is_delete = 0 and is_used = 1").uniqueResult(0);
|
||||
JSONObject empPoint = WQL.getWO("sch_point").addParamMap(MapOf.of("flag", "2", "point_code", point_code, "point_type", StatusEnum.POINT_LOCATION_EMP.getCode())).process().uniqueResult(0);
|
||||
@@ -100,11 +87,11 @@ public class AgvInstService {
|
||||
if (StringUtils.isEmpty(cacheVehile)) {
|
||||
throw new BadRequestException("缓存线:"+nextPoint+"没有可用空载具");
|
||||
}
|
||||
taskType = AcsTaskEnum.CACHELINE_OUT.getCode();
|
||||
taskType = AcsTaskEnum.TASK_CACHELINE_OUT.getCode();
|
||||
}
|
||||
|
||||
//生成任务nextPoint
|
||||
PointToPointTask pointTask = new PointToPointTask();
|
||||
SpeMachineryTask pointTask = new SpeMachineryTask();
|
||||
JSONObject taskForm = new JSONObject(MapOf.of("start_device_code",point_code,
|
||||
"next_device_code",nextPoint,"return_device_code", empPoint.getString("point_code"),"vehicle_code",
|
||||
cacheVehile,"quantity", quantity,"product_area",devicePoint.getString("product_area"),"type",taskType));
|
||||
@@ -143,10 +130,10 @@ public class AgvInstService {
|
||||
if (StringUtils.isEmpty(cacheVehile)) {
|
||||
throw new BadRequestException("缓存线:"+startPoint+"没有可用空载具");
|
||||
}
|
||||
PointToPointTask pointTask = new PointToPointTask();
|
||||
SpeMachineryTask pointTask = new SpeMachineryTask();
|
||||
JSONObject taskForm = new JSONObject(MapOf.of("start_device_code",startPoint,
|
||||
"next_device_code",point_code,"return_device_code", startPoint,"vehicle_code",
|
||||
cacheVehile,"product_area",devicePoint.getString("product_area"),"type",AcsTaskEnum.CACHELINE_OUT.getCode()));
|
||||
cacheVehile,"product_area",devicePoint.getString("product_area"),"type",AcsTaskEnum.TASK_CACHELINE_OUT.getCode()));
|
||||
String taskId = pointTask.createTask(taskForm);
|
||||
log.info(OPT_NAME+"callMatter taskID:{}",taskId);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -71,8 +72,10 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
|
||||
String product_area = MapUtil.getStr(whereJson, "product_area");
|
||||
String product_series = "";
|
||||
// 员工只能看到自己创建的工单
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
SysUser one = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, currentUsername));
|
||||
String currentUserId = "";
|
||||
if (!SecurityUtils.getCurrentUsername().equals("admin")) currentUserId = SecurityUtils.getCurrentUserId();
|
||||
if (!one.getIsAdmin()) currentUserId = SecurityUtils.getCurrentUserId();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
//map.put("order_status", order_status);
|
||||
|
||||
@@ -14,12 +14,11 @@ import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wms.pda.dto.CachelineVehileMaterialDto;
|
||||
import org.nl.wms.pda.dto.MaterialDto;
|
||||
import org.nl.wms.pda.service.CacheLineHandService;
|
||||
import org.nl.wms.sch.service.impl.TaskServiceImpl;
|
||||
import org.nl.wms.sch.tasks.PointToPointTask;
|
||||
import org.nl.wms.sch.tasks.SpeMachineryTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -28,7 +27,6 @@ import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -36,8 +34,6 @@ import java.util.stream.Collectors;
|
||||
* 1、比如要N个空箱子或N个满料料箱。查询出来以后,一个码都无法扫描出来,这时候标记这些箱子为异常
|
||||
* 2、箱码扫描不出来,则用手持经过WMS中转传输给WCS,最后给电器。
|
||||
* 3、AGV搬运过程中异常(非AGVERR),查询条件为设备、起始点等未完成的时候(有可能不是异常)。
|
||||
*
|
||||
* @author gbx
|
||||
* @date 2023/3/22
|
||||
*/
|
||||
@Service
|
||||
@@ -46,7 +42,6 @@ import java.util.stream.Collectors;
|
||||
public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
private final RedisUtils redisUtils;
|
||||
private final TaskServiceImpl taskServiceImp;
|
||||
private final WmsToAcsServiceImpl wmsToAcsServiceImpl;
|
||||
@Autowired
|
||||
private LocalCache cache;
|
||||
|
||||
@@ -58,7 +53,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
|
||||
@Override
|
||||
public List<MaterialDto> materialQuery(String param) {
|
||||
AtomicBoolean atomicBoolean = new AtomicBoolean(false);
|
||||
// StopWatch stopWatch = new StopWatch();
|
||||
// stopWatch.start();
|
||||
// stopWatch.stop();
|
||||
@@ -144,6 +138,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
@Override
|
||||
public void instOperation(JSONObject param) {
|
||||
String optType = param.getString("opt_type");
|
||||
SpeMachineryTask SpeMachineryTask = new SpeMachineryTask();
|
||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
||||
JSONObject taskObject = taskTab.query("task_id =" + param.getString("instruct_uuid")).uniqueResult(0);
|
||||
//01-取消、02-完成、03-重发,根据操作类型执行相关操作
|
||||
@@ -151,10 +146,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
updateTaskStatus(taskObject, optType);
|
||||
}
|
||||
if("03".equals(optType)) {
|
||||
JSONArray taskArray = new JSONArray();
|
||||
taskArray.add(taskObject);
|
||||
//任务下发
|
||||
wmsToAcsServiceImpl.issueTaskToAcs(taskArray);
|
||||
SpeMachineryTask.createTask(taskObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,165 +0,0 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
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.extern.slf4j.Slf4j;
|
||||
import org.nl.common.enums.AcsTaskEnum;
|
||||
import org.nl.common.enums.InterfaceLogType;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 普通点对点任务
|
||||
*/
|
||||
@Slf4j
|
||||
public class PointToPointTask extends AbstractAcsTask {
|
||||
|
||||
private static String OPT_NAME = "ACS回调# ";
|
||||
|
||||
@Override
|
||||
public void updateTaskStatus(JSONObject param,String status) {
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
WQLObject pointTable = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject cacheVehTable = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
WQLObject deviceTable = WQLObject.getWQLObject("pdm_bi_device");
|
||||
log.info(InterfaceLogType.ACS_TO_LMS.getDesc());
|
||||
|
||||
//参数:
|
||||
String taskId = param.getString("taskId");
|
||||
String workprocedureCode = param.getString("workorder_code");
|
||||
//入箱条码,出箱条码
|
||||
String inboxtxm = param.getString("inboxtxm");
|
||||
String outboxtxm = param.getString("outboxtxm");
|
||||
|
||||
// 指令执行中
|
||||
JSONObject task = taskTable.query("task_id = '" + taskId + "'").uniqueResult(0);
|
||||
String taskStatus = task.getString("task_status");
|
||||
AcsTaskEnum taskTypeEnum = AcsTaskEnum.getType(task.getString("task_type"));
|
||||
try {
|
||||
if (AcsTaskEnum.ACS_RUNDING.getCode().equals(status)) {
|
||||
if (!taskStatus.equals(StatusEnum.TASK_PUBLISH.getCode())){
|
||||
log.error(OPT_NAME+"任务:{} 状态异常不是处于下发状态:{}",taskId,taskStatus);
|
||||
}
|
||||
// 更新指令为执行中
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_RUNNING.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+taskId+"'");
|
||||
//如果是缓存线任务:释放缓存线对应载具
|
||||
// 如果终点是缓存线,出箱的时候代表已经入了满料箱子
|
||||
//根据任务类型确认更新
|
||||
switch (taskTypeEnum){
|
||||
case PRODUCT_MAC:
|
||||
break;
|
||||
case PRODUCT_CACHE:
|
||||
//到缓存线说明需要出一个空箱号
|
||||
cacheVehTable.delete("vehicle_code = '" + outboxtxm + "'");
|
||||
break;
|
||||
case CACHELINE_OUT:
|
||||
//到缓存线说明需要出满箱号
|
||||
cacheVehTable.delete("vehicle_code = '" + outboxtxm + "'");
|
||||
break;
|
||||
default:
|
||||
log.error(OPT_NAME+"未定义任务类型:{}",task.getString("task_type"));
|
||||
throw new BadRequestException(OPT_NAME+"未定义任务类型:"+task.getString("task_type"));
|
||||
}
|
||||
}
|
||||
// 指令完成
|
||||
if (AcsTaskEnum.ACS_FINISH.getCode().equals(status)) {
|
||||
if (!taskStatus.equals(StatusEnum.TASK_RUNNING.getCode())) {
|
||||
log.error(OPT_NAME + "任务:{} 状态异常不是处于运行中状态:{}", taskId, taskStatus);
|
||||
}
|
||||
switch (taskTypeEnum) {
|
||||
case PRODUCT_MAC:case CACHELINE_OUT:
|
||||
//到专机:更新设备上料位物料数量
|
||||
String point_code2 = task.getString("point_code2");
|
||||
JSONObject pointInfo = pointTable.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
JSONObject device = deviceTable.query("device_code = '" + pointInfo.getString("device_code") + "'").uniqueResult(0);
|
||||
task.getDouble("material_qty");
|
||||
double currentQty = device.getDouble("deviceinstor_qty") + task.getDouble("material_qty");
|
||||
deviceTable.update(MapOf.of("deviceinstor_qty", String.valueOf(currentQty)), "device_code = '" + pointInfo.getString("device_code") + "'");
|
||||
break;
|
||||
case PRODUCT_CACHE:
|
||||
cacheVehTable.insert(MapOf.of("quantity", task.getString("material_qty"),
|
||||
"material_id", task.getString("material_id"),
|
||||
"vehicle_code", inboxtxm,
|
||||
"vehicle_status", StatusEnum.CACHE_VEL_FULL.getCode(),
|
||||
//工单,工序?
|
||||
"workorder_code", workprocedureCode,
|
||||
"create_time", DateUtil.now(),
|
||||
"update_time", DateUtil.now()
|
||||
//物料规格,物料名称 从物料信息表关联查询
|
||||
));
|
||||
break;
|
||||
default:
|
||||
log.error(OPT_NAME + "未定义任务类型:{}", task.getString("task_type"));
|
||||
throw new BadRequestException(OPT_NAME + "未定义任务类型:" + task.getString("task_type"));
|
||||
}
|
||||
}
|
||||
}catch (Exception ex){
|
||||
log.error(OPT_NAME+"updateStatus error:{}",ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
String start_point_code = form.getString("start_point_code");
|
||||
String next_point_code = form.getString("next_point_code");
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
String type = form.getString("type");
|
||||
if (StrUtil.isEmpty(start_point_code)) {
|
||||
throw new BadRequestException("起点不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(next_point_code)) {
|
||||
throw new BadRequestException("终点不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("载具不能为空!");
|
||||
}
|
||||
String taskdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
JSONObject task = new JSONObject();
|
||||
task.put("taskdtl_id", taskdtl_id);
|
||||
task.put("task_id", taskdtl_id);
|
||||
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.put("task_type", type);
|
||||
task.put("task_status", "01");
|
||||
task.put("start_point_code", start_point_code);
|
||||
task.put("next_point_code", next_point_code);
|
||||
task.put("vehicle_code", vehicle_code);
|
||||
task.put("handle_class", this.getClass().getName());
|
||||
task.put("finished_type", "01");
|
||||
task.put("is_delete", "0");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
task.put("create_id", currentUserId);
|
||||
task.put("create_name", SecurityUtils.getCurrentNickName());
|
||||
task.put("update_optid", currentUserId);
|
||||
task.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||
task.put("create_time", DateUtil.now());
|
||||
task.put("update_time", DateUtil.now());
|
||||
task.put("priority", "1");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
||||
return taskdtl_id;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void cancel(String taskId) {
|
||||
log.info(OPT_NAME+"cancel taskID:{}",taskId);
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
//专机-专机
|
||||
//专机-缓存线
|
||||
//缓存线出库
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_CANNEL.getCode()),"task_id = '"+taskId+"'");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
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.extern.slf4j.Slf4j;
|
||||
import org.nl.common.enums.AcsTaskEnum;
|
||||
import org.nl.common.enums.InterfaceLogType;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 专机任务
|
||||
*/
|
||||
@Slf4j
|
||||
public class SpeMachineryTask extends AbstractAcsTask {
|
||||
private final Map<String,SpeStatusHandler > SpeHandles= new HashMap<>();
|
||||
private static String OPT_NAME = "ACS回调# ";
|
||||
|
||||
public SpeMachineryTask() {
|
||||
SpeHandles.put(AcsTaskEnum.TASK_PRODUCT_MAC.name() ,new Spe2Spe());
|
||||
SpeHandles.put(AcsTaskEnum.TASK_PRODUCT_CACHE.name() ,new Spe2Cache());
|
||||
SpeHandles.put(AcsTaskEnum.TASK_CACHELINE_OUT.name() ,new Cache2Spe());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTaskStatus(JSONObject param,String status) {
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
log.info(InterfaceLogType.ACS_TO_LMS.getDesc());
|
||||
// 指令执行中
|
||||
JSONObject task = taskTable.query("task_id = '" + param.getString("taskId") + "'").uniqueResult(0);
|
||||
AcsTaskEnum taskType = AcsTaskEnum.getType(task.getString("task_type"),"TASK_");
|
||||
try {
|
||||
SpeHandles.get(taskType.name()).handle(param,status,task);
|
||||
}catch (Exception ex){
|
||||
log.error(OPT_NAME+"updateStatus error:{}",ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
String start_point_code = form.getString("start_point_code");
|
||||
String next_point_code = form.getString("next_point_code");
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
String type = form.getString("type");
|
||||
if (StrUtil.isEmpty(start_point_code)) {
|
||||
throw new BadRequestException("起点不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(next_point_code)) {
|
||||
throw new BadRequestException("终点不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("载具不能为空!");
|
||||
}
|
||||
String taskdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
JSONObject task = new JSONObject();
|
||||
task.put("taskdtl_id", taskdtl_id);
|
||||
task.put("task_id", taskdtl_id);
|
||||
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task.put("task_type", type);
|
||||
task.put("task_status", "01");
|
||||
task.put("start_point_code", start_point_code);
|
||||
task.put("next_point_code", next_point_code);
|
||||
task.put("vehicle_code", vehicle_code);
|
||||
task.put("handle_class", this.getClass().getName());
|
||||
task.put("finished_type", "01");
|
||||
task.put("is_delete", "0");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
task.put("create_id", currentUserId);
|
||||
task.put("create_name", SecurityUtils.getCurrentNickName());
|
||||
task.put("update_optid", currentUserId);
|
||||
task.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||
task.put("create_time", DateUtil.now());
|
||||
task.put("update_time", DateUtil.now());
|
||||
task.put("priority", "1");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
||||
return taskdtl_id;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void cancel(String taskId) {
|
||||
log.info(OPT_NAME+"cancel taskID:{}",taskId);
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
//专机-专机
|
||||
//专机-缓存线
|
||||
//缓存线出库
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_CANNEL.getCode()),"task_id = '"+taskId+"'");
|
||||
|
||||
}
|
||||
interface SpeStatusHandler{
|
||||
void handle(JSONObject param,String status,JSONObject task);
|
||||
}
|
||||
class Spe2Spe implements SpeStatusHandler{
|
||||
@Override
|
||||
public void handle(JSONObject param, String sta,JSONObject task) {
|
||||
AcsTaskEnum status = AcsTaskEnum.getType(sta,"status_");
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
WQLObject pointTable = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject deviceTable = WQLObject.getWQLObject("pdm_bi_device");
|
||||
|
||||
switch (status){
|
||||
case STATUS_START:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_RUNNING.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
break;
|
||||
case STATUS_RUNDING:
|
||||
break;
|
||||
case STATUS_FINISH:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_FINISH.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
//到专机:更新设备上料位物料数量
|
||||
String point_code2 = task.getString("point_code2");
|
||||
JSONObject pointInfo = pointTable.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
JSONObject device = deviceTable.query("device_code = '" + pointInfo.getString("device_code") + "'").uniqueResult(0);
|
||||
task.getDouble("material_qty");
|
||||
double currentQty = device.getDouble("deviceinstor_qty") + task.getDouble("material_qty");
|
||||
deviceTable.update(MapOf.of("deviceinstor_qty", String.valueOf(currentQty)), "device_code = '" + pointInfo.getString("device_code") + "'");
|
||||
break;
|
||||
default:
|
||||
log.error(OPT_NAME+"未定义任务状态:{}",sta);
|
||||
throw new BadRequestException(OPT_NAME+"未定义任务状态:"+sta);
|
||||
}
|
||||
}
|
||||
}
|
||||
class Spe2Cache implements SpeStatusHandler{
|
||||
@Override
|
||||
public void handle(JSONObject param, String sta,JSONObject task) {
|
||||
AcsTaskEnum status = AcsTaskEnum.getType(sta,"status_");
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
WQLObject cacheVehTable = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
String workprocedureCode = param.getString("workorder_code");
|
||||
String inboxtxm = param.getString("inboxtxm");
|
||||
String outboxtxm = param.getString("outboxtxm");
|
||||
switch (status){
|
||||
case STATUS_START:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_RUNNING.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
break;
|
||||
case STATUS_RUNDING:
|
||||
cacheVehTable.delete("vehicle_code = '" + outboxtxm + "'");
|
||||
break;
|
||||
case STATUS_FINISH:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_FINISH.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
cacheVehTable.insert(MapOf.of("quantity", task.getString("material_qty"),
|
||||
"material_id", task.getString("material_id"),
|
||||
"vehicle_code", inboxtxm,
|
||||
"vehicle_status", StatusEnum.CACHE_VEL_FULL.getCode(),
|
||||
//工单,工序?
|
||||
"workorder_code", workprocedureCode,
|
||||
"create_time", DateUtil.now(),
|
||||
"update_time", DateUtil.now()
|
||||
//物料规格,物料名称 从物料信息表关联查询
|
||||
));
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException(OPT_NAME+"未定义任务状态:"+sta);
|
||||
}
|
||||
}
|
||||
}
|
||||
class Cache2Spe implements SpeStatusHandler{
|
||||
@Override
|
||||
public void handle(JSONObject param, String sta,JSONObject task) {
|
||||
AcsTaskEnum status = AcsTaskEnum.getType(sta,"status_");
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
WQLObject cacheVehTable = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
WQLObject pointTable = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject deviceTable = WQLObject.getWQLObject("pdm_bi_device");
|
||||
String outboxtxm = param.getString("outboxtxm");
|
||||
|
||||
switch (status){
|
||||
case STATUS_START:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_RUNNING.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
cacheVehTable.delete("vehicle_code = '" + outboxtxm + "'");
|
||||
break;
|
||||
case STATUS_FINISH:
|
||||
taskTable.update(MapOf.of("task_status",StatusEnum.TASK_FINISH.getCode(),"update_name","acs","update_time", DateUtil.now()),"task_id = '"+task.getString("task_id")+"'");
|
||||
|
||||
String point_code2 = task.getString("point_code2");
|
||||
JSONObject pointInfo = pointTable.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
JSONObject device = deviceTable.query("device_code = '" + pointInfo.getString("device_code") + "'").uniqueResult(0);
|
||||
task.getDouble("material_qty");
|
||||
double currentQty = device.getDouble("deviceinstor_qty") + task.getDouble("material_qty");
|
||||
deviceTable.update(MapOf.of("deviceinstor_qty", String.valueOf(currentQty)), "device_code = '" + pointInfo.getString("device_code") + "'");
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException(OPT_NAME+"未定义任务状态:"+sta);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/cachelineRegionRelation',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/cachelineRegionRelation/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/cachelineRegionRelation',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -140,7 +140,7 @@
|
||||
<el-table-column
|
||||
v-permission="['admin','storagevehicleinfo:edit','storagevehicleinfo:del']"
|
||||
label="操作"
|
||||
width="50px"
|
||||
width="100px"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
|
||||
@@ -69,8 +69,8 @@
|
||||
<el-form-item label="位置顺序号" prop="positionOrder_no">
|
||||
<el-input v-model="form.positionOrder_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缓存线编码" prop="cacheLine_code">
|
||||
<el-input v-model="form.cacheLine_code" style="width: 200px;" />
|
||||
<el-form-item label="缓存线编码" prop="cacheline_code">
|
||||
<el-input v-model="form.cacheline_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缓存线层数" prop="layer_num">
|
||||
<el-input v-model="form.layer_num" style="width: 200px;" />
|
||||
@@ -152,7 +152,7 @@
|
||||
<el-table-column prop="position_code" label="位置编码" width="120"/>
|
||||
<el-table-column prop="position_name" label="名字" width="120"/>
|
||||
<el-table-column prop="positionOrder_no" label="顺序号" />
|
||||
<el-table-column prop="cacheLine_code" label="缓存线编码" />
|
||||
<el-table-column prop="cacheline_code" label="缓存线编码" />
|
||||
<el-table-column prop="layer_num" label="层数" />
|
||||
<el-table-column prop="priority_layer_no" label="优先层顺序" />
|
||||
<el-table-column prop="order_no" label="料箱展示顺序号" width="120"/>
|
||||
@@ -161,7 +161,6 @@
|
||||
<el-table-column prop="is_empty" label="是否空位" />
|
||||
<el-table-column prop="is_show" label="是否展示" />
|
||||
<el-table-column prop="is_active" label="是否可用" />
|
||||
<el-table-column prop="is_delete" label="是否删除" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
@@ -189,7 +188,7 @@ const defaultForm = {
|
||||
position_code: null,
|
||||
position_name: null,
|
||||
positionOrder_no: null,
|
||||
cacheLine_code: null,
|
||||
cacheline_code: null,
|
||||
layer_num: null,
|
||||
priority_layer_no: null,
|
||||
order_no: null,
|
||||
@@ -231,7 +230,7 @@ export default {
|
||||
positionOrder_no: [
|
||||
{ required: true, message: '位置顺序号不能为空', trigger: 'blur' }
|
||||
],
|
||||
cacheLine_code: [
|
||||
cacheline_code: [
|
||||
{ required: true, message: '缓存线编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
layer_num: [
|
||||
|
||||
136
mes/qd/src/views/wms/cacheline/region/index.vue
Normal file
136
mes/qd/src/views/wms/cacheline/region/index.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入位置编码或名称"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="区域编码" prop="region_code">
|
||||
<el-input v-model="form.region_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缓存线编码" prop="cacheline_code">
|
||||
<el-input v-model="form.cacheline_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可用" prop="is_active">
|
||||
<el-select
|
||||
v-model="form.is_active"
|
||||
placeholder=""
|
||||
style="width: 370px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IS_OR_NOT"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="region_code" label="区域编码" />
|
||||
<el-table-column prop="cacheline_code" label="缓存线编码" />
|
||||
<el-table-column prop="create_time" label="创建时间" />
|
||||
<el-table-column prop="update_time" label="更新时间" />
|
||||
<el-table-column prop="is_active" label="是否可用" >
|
||||
<template slot-scope="scop">
|
||||
{{scop.row.is_active ? '是' : '否'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudCachelineRegionRelation from '@/api/wms/cacheline/region/cachelineRegionRelation'
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
relation_id: null,
|
||||
region_code: null,
|
||||
cacheline_code: null,
|
||||
create_time: null,
|
||||
update_time: null,
|
||||
is_active: null,
|
||||
is_delete: null
|
||||
}
|
||||
export default {
|
||||
name: 'CachelineRegionRelation',
|
||||
dicts: ['IS_OR_NOT'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '个缓存线区域关系', url: 'api/cachelineRegionRelation', idField: 'relation_id', sort: 'relation_id,desc', crudMethod: { ...crudCachelineRegionRelation }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
region_code: [
|
||||
{ required: true, message: '区域编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
cacheline_code: [
|
||||
{ required: true, message: '缓存线编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_active: [
|
||||
{ required: true, message: '是否可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_delete: [
|
||||
{ required: true, message: '是否删除不能为空', trigger: 'blur' }
|
||||
]
|
||||
} }
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -12,6 +12,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.opc.Device;
|
||||
@@ -53,6 +57,8 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
ParamService acsConfigService = SpringContextHolder.getBean(ParamServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
int mode = 0;
|
||||
int error = 0;
|
||||
@@ -255,6 +261,13 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号move:" + last_move + "->" + move);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -11,11 +11,16 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
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.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.route.service.RouteLineService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
@@ -52,8 +57,10 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
|
||||
ParamService acsConfigService = SpringContextHolder.getBean(ParamServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
// @Autowired
|
||||
// ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
@@ -185,6 +192,13 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号in_pcsn:" + last_in_pcsn + "->" + in_pcsn);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -11,11 +11,16 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
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.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.route.service.RouteLineService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
@@ -52,8 +57,10 @@ public class HailiangCleaningMachineDeviceDriver extends AbstractOpcDeviceDriver
|
||||
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
// @Autowired
|
||||
// ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(.class);
|
||||
@Autowired
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
@@ -204,6 +211,13 @@ public class HailiangCleaningMachineDeviceDriver extends AbstractOpcDeviceDriver
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号pause:" + last_pause + "->" + pause);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -71,6 +75,8 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
@@ -173,6 +179,13 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
|
||||
full_number = this.itemProtocol.getItem_full_number();
|
||||
silo_material_no = this.itemProtocol.getItem_silo_material_no();
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -42,6 +46,9 @@ public class HailiangElevatorWiringDeviceDriver extends AbstractOpcDeviceDriver
|
||||
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
String last_container_type_desc;
|
||||
@@ -136,6 +143,13 @@ public class HailiangElevatorWiringDeviceDriver extends AbstractOpcDeviceDriver
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号move:" + last_move + "->" + move);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ 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.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -76,6 +78,8 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -76,6 +80,9 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
NDCAgvServiceImpl agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
|
||||
int status = 0;//线体状态
|
||||
@@ -273,6 +280,13 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号line_ready:" + last_line_ready + "->" + line_ready);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -42,6 +46,8 @@ public class HailiangFoldingDiscSmartDeviceDriver extends AbstractOpcDeviceDrive
|
||||
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
//放货准备锁
|
||||
String putReadyLock = null;
|
||||
@@ -136,6 +142,13 @@ public class HailiangFoldingDiscSmartDeviceDriver extends AbstractOpcDeviceDrive
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号move:" + last_move + "->" + move);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -77,6 +81,8 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
|
||||
@@ -232,6 +238,13 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -42,6 +46,8 @@ public class HailiangPaintLineDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
//放货准备锁
|
||||
String putReadyLock = null;
|
||||
@@ -136,6 +142,13 @@ public class HailiangPaintLineDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号move:" + last_move + "->" + move);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -68,6 +72,9 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
String last_container_type_desc;
|
||||
@@ -274,6 +281,13 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号device_online:" + last_device_online + "->" + device_online);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -71,6 +75,8 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
|
||||
@@ -213,6 +219,13 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
|
||||
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -76,6 +80,8 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
@@ -223,6 +229,13 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号order:" + last_order + "->" + order);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -64,6 +68,8 @@ public class HailiangSpecialPickStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
@@ -191,6 +197,13 @@ public class HailiangSpecialPickStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号order:" + last_order + "->" + order);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -72,6 +76,8 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
|
||||
String container;
|
||||
@@ -197,6 +203,13 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号order:" + last_order + "->" + order);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -58,6 +62,8 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
@@ -235,6 +241,13 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号all_ready:" + last_all_ready + "->" + all_ready);
|
||||
}
|
||||
if (line_error != last_line_error) {
|
||||
if (line_error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(line_error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(line_error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"line_error" ,String.valueOf(line_error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号line_error:" + last_line_error + "->" + line_error);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -42,6 +46,9 @@ public class HailiangThreestationSmartDeviceDriver extends AbstractOpcDeviceDriv
|
||||
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container_type_desc;
|
||||
String last_container_type_desc;
|
||||
//放货准备锁
|
||||
@@ -140,6 +147,13 @@ public class HailiangThreestationSmartDeviceDriver extends AbstractOpcDeviceDriv
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号move:" + last_move + "->" + move);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -55,6 +59,8 @@ public class HailiangHailiangxjplcTestDeviceDriver extends AbstractOpcDeviceDriv
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
AgvService agvService = SpringContextHolder.getBean(AgvService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
@@ -66,64 +72,64 @@ public class HailiangHailiangxjplcTestDeviceDriver extends AbstractOpcDeviceDriv
|
||||
protected boolean has_goods_tag = false;
|
||||
|
||||
int heartbeat = 0;
|
||||
int mode =0;
|
||||
int error =0;
|
||||
int error_num =0;
|
||||
int open_time =0;
|
||||
int close_time =0;
|
||||
int ready_time =0;
|
||||
int running_time =0;
|
||||
int error_time =0;
|
||||
int voltage =0;
|
||||
int temperature =0;
|
||||
int current =0;
|
||||
int material =0;
|
||||
int lack_material =0;
|
||||
int full_material =0;
|
||||
int storage_qty =0;
|
||||
int feeding_qty =0;
|
||||
int blanking_qty =0;
|
||||
int qualified_qty =0;
|
||||
int unqualified_qty =0;
|
||||
int finish =0;
|
||||
int task =0;
|
||||
int noload_electricity_consumption =0;
|
||||
int prod_electricity_consumption =0;
|
||||
int gas_consumption =0;
|
||||
int water_consumption =0;
|
||||
int oil_level =0;
|
||||
int monthly_electricity_consumption =0;
|
||||
int pause =0;
|
||||
int mode = 0;
|
||||
int error = 0;
|
||||
int error_num = 0;
|
||||
int open_time = 0;
|
||||
int close_time = 0;
|
||||
int ready_time = 0;
|
||||
int running_time = 0;
|
||||
int error_time = 0;
|
||||
int voltage = 0;
|
||||
int temperature = 0;
|
||||
int current = 0;
|
||||
int material = 0;
|
||||
int lack_material = 0;
|
||||
int full_material = 0;
|
||||
int storage_qty = 0;
|
||||
int feeding_qty = 0;
|
||||
int blanking_qty = 0;
|
||||
int qualified_qty = 0;
|
||||
int unqualified_qty = 0;
|
||||
int finish = 0;
|
||||
int task = 0;
|
||||
int noload_electricity_consumption = 0;
|
||||
int prod_electricity_consumption = 0;
|
||||
int gas_consumption = 0;
|
||||
int water_consumption = 0;
|
||||
int oil_level = 0;
|
||||
int monthly_electricity_consumption = 0;
|
||||
int pause = 0;
|
||||
|
||||
|
||||
int last_mode =0;
|
||||
int last_error =0;
|
||||
int last_error_num =0;
|
||||
int last_open_time =0;
|
||||
int last_close_time =0;
|
||||
int last_ready_time =0;
|
||||
int last_running_time =0;
|
||||
int last_error_time =0;
|
||||
int last_voltage =0;
|
||||
int last_temperature =0;
|
||||
int last_current =0;
|
||||
int last_material =0;
|
||||
int last_lack_material =0;
|
||||
int last_full_material =0;
|
||||
int last_storage_qty =0;
|
||||
int last_feeding_qty =0;
|
||||
int last_blanking_qty =0;
|
||||
int last_qualified_qty =0;
|
||||
int last_unqualified_qty =0;
|
||||
int last_finish =0;
|
||||
int last_task =0;
|
||||
int last_noload_electricity_consumption =0;
|
||||
int last_prod_electricity_consumption =0;
|
||||
int last_gas_consumption =0;
|
||||
int last_water_consumption =0;
|
||||
int last_oil_level =0;
|
||||
int last_monthly_electricity_consumption =0;
|
||||
int last_pause =0;
|
||||
int last_mode = 0;
|
||||
int last_error = 0;
|
||||
int last_error_num = 0;
|
||||
int last_open_time = 0;
|
||||
int last_close_time = 0;
|
||||
int last_ready_time = 0;
|
||||
int last_running_time = 0;
|
||||
int last_error_time = 0;
|
||||
int last_voltage = 0;
|
||||
int last_temperature = 0;
|
||||
int last_current = 0;
|
||||
int last_material = 0;
|
||||
int last_lack_material = 0;
|
||||
int last_full_material = 0;
|
||||
int last_storage_qty = 0;
|
||||
int last_feeding_qty = 0;
|
||||
int last_blanking_qty = 0;
|
||||
int last_qualified_qty = 0;
|
||||
int last_unqualified_qty = 0;
|
||||
int last_finish = 0;
|
||||
int last_task = 0;
|
||||
int last_noload_electricity_consumption = 0;
|
||||
int last_prod_electricity_consumption = 0;
|
||||
int last_gas_consumption = 0;
|
||||
int last_water_consumption = 0;
|
||||
int last_oil_level = 0;
|
||||
int last_monthly_electricity_consumption = 0;
|
||||
int last_pause = 0;
|
||||
|
||||
|
||||
Boolean isonline = true;
|
||||
@@ -167,8 +173,8 @@ public class HailiangHailiangxjplcTestDeviceDriver extends AbstractOpcDeviceDriv
|
||||
int flag = 0;
|
||||
|
||||
|
||||
int agvphase=0;
|
||||
int index =0;
|
||||
int agvphase = 0;
|
||||
int index = 0;
|
||||
|
||||
String device_code;
|
||||
|
||||
@@ -179,7 +185,7 @@ public class HailiangHailiangxjplcTestDeviceDriver extends AbstractOpcDeviceDriv
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
public void execute() {
|
||||
device_code = this.getDeviceCode();
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
@@ -213,12 +219,19 @@ public class HailiangHailiangxjplcTestDeviceDriver extends AbstractOpcDeviceDriv
|
||||
|
||||
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);
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (error != last_error) {
|
||||
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error);
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +246,7 @@ public class HailiangHailiangxjplcTestDeviceDriver extends AbstractOpcDeviceDriv
|
||||
|
||||
protected void thingToNothing() {
|
||||
log.debug("从有货到无货 清理数据");
|
||||
logServer.deviceExecuteLog(this.device_code,"","","光电信号切换,刷新请求标记:"+this.requireSucess);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "光电信号切换,刷新请求标记:" + this.requireSucess);
|
||||
|
||||
this.setRequireSucess(false);
|
||||
this.setApplySucess(false);
|
||||
|
||||
@@ -13,6 +13,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
@@ -55,6 +59,8 @@ public class HailiangSmartplcTestDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
||||
@Autowired
|
||||
AgvService agvService = SpringContextHolder.getBean(AgvService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
private Date instruction_require_time = new Date();
|
||||
private Date instruction_finished_time = new Date();
|
||||
@@ -115,6 +121,13 @@ public class HailiangSmartplcTestDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
}
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.opc.Device;
|
||||
@@ -30,6 +32,8 @@ public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
|
||||
@@ -12,6 +12,8 @@ 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.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -53,6 +55,9 @@ public class PhotoelectricInspectionSiteDeviceDriver extends AbstractOpcDeviceDr
|
||||
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
String last_container_type_desc;
|
||||
|
||||
@@ -7,10 +7,13 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,6 +28,8 @@ import java.util.Map;
|
||||
public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, DeviceStageMonitor {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
int open = 0;
|
||||
int close = 0;
|
||||
|
||||
@@ -15,6 +15,8 @@ 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.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
@@ -61,6 +63,9 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
|
||||
@Autowired
|
||||
ParamService paramService = SpringContextHolder.getBean(ParamService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
String container_type_desc;
|
||||
String last_container_type_desc;
|
||||
|
||||
@@ -18,6 +18,10 @@ 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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
@@ -61,7 +65,9 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
|
||||
ParamService paramService = SpringContextHolder.getBean(ParamService.class);
|
||||
@Autowired
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
|
||||
;
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
|
||||
String barcode = null;
|
||||
String formatcode = null;
|
||||
@@ -171,6 +177,13 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
|
||||
}
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
}
|
||||
if (mode == 2 && move != 0 && task > 0) {
|
||||
//inst_message
|
||||
|
||||
@@ -19,6 +19,8 @@ import org.nl.acs.device_driver.ScannerDeviceDriver;
|
||||
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.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -67,6 +69,9 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
String container;
|
||||
|
||||
protected String barcode = null;
|
||||
|
||||
@@ -13,6 +13,8 @@ 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.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -46,6 +48,8 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
|
||||
String container;
|
||||
|
||||
@@ -15,6 +15,8 @@ import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
|
||||
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.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -53,6 +55,8 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
||||
@Autowired
|
||||
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
|
||||
Integer hasGoods = 0;
|
||||
|
||||
@@ -7,16 +7,22 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.ScannerDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.socket.SocketConfig;
|
||||
import org.nl.acs.udw.UnifiedDataAccessor;
|
||||
import org.nl.acs.udw.UnifiedDataAccessorFactory;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/** 标准版扫码器 */
|
||||
@Slf4j
|
||||
@Data
|
||||
public class StandardScannerDeviceDriver extends AbstractDeviceDriver
|
||||
implements ScannerDeviceDriver, DeviceDriver, DeviceStageMonitor {
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
UnifiedDataAccessor accessor_value;
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.nl.acs.history;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.nl.modules.system.domain.Dict;
|
||||
import org.nl.modules.system.service.DictDetailService;
|
||||
import org.nl.modules.system.service.DictService;
|
||||
import org.nl.modules.system.service.dto.DictDetailDto;
|
||||
import org.nl.modules.system.service.impl.DictDetailServiceImpl;
|
||||
import org.nl.modules.system.service.impl.DictServiceImpl;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @author: geng by
|
||||
* @createDate: 2023/3/15
|
||||
*/
|
||||
public class ErrorUtil {
|
||||
|
||||
public static ConcurrentHashMap<String, List<DictDetailDto>> dictMap = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
public static String getDictDetail(String type, String error_code) {
|
||||
getDict();
|
||||
List<DictDetailDto> dictDetailDtos = dictMap.get(type);
|
||||
String detail = null;
|
||||
if (ObjectUtil.isNotEmpty(dictDetailDtos)) {
|
||||
for (int i = 0; i < dictDetailDtos.size(); i++) {
|
||||
DictDetailDto dictDetailDto = dictDetailDtos.get(i);
|
||||
String value = dictDetailDto.getValue();
|
||||
String label = dictDetailDto.getLabel();
|
||||
if (StrUtil.equals(value, error_code)) {
|
||||
detail = label;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return detail == null ? "字典表未配置对应的报警信息" : detail;
|
||||
}
|
||||
|
||||
|
||||
public static void getDict() {
|
||||
if (ObjectUtil.isEmpty(dictMap)) {
|
||||
DictDetailService dictDetailService = SpringContextHolder.getBean(DictDetailServiceImpl.class);
|
||||
DictService dictService = SpringContextHolder.getBean(DictServiceImpl.class);
|
||||
List<Dict> dictDtos = dictService.queryAll();
|
||||
for (int i = 0; i < dictDtos.size(); i++) {
|
||||
Dict dictDto = dictDtos.get(i);
|
||||
dictMap.put(dictDto.getName(), getDict(dictDto.getName(), t -> {
|
||||
return dictDetailService.getDictByName(t);
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static List<DictDetailDto> getDict(String name, Function<String, List<DictDetailDto>> f) {
|
||||
return f.apply(name);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
package org.nl.acs.history.rest;
|
||||
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
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 gengby
|
||||
* @date 2023-03-15
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "设备报警记录管理")
|
||||
@RequestMapping("/api/deviceErrorLog")
|
||||
@Slf4j
|
||||
public class DeviceErrorLogController {
|
||||
|
||||
private final DeviceErrorLogService acsDeviceErrorLogService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询设备报警记录")
|
||||
@ApiOperation("查询设备报警记录")
|
||||
//@PreAuthorize("@el.check('acsDeviceErrorLog:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(acsDeviceErrorLogService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增设备报警记录")
|
||||
@ApiOperation("新增设备报警记录")
|
||||
//@PreAuthorize("@el.check('acsDeviceErrorLog:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody DeviceErrorLogDto dto){
|
||||
acsDeviceErrorLogService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改设备报警记录")
|
||||
@ApiOperation("修改设备报警记录")
|
||||
//@PreAuthorize("@el.check('acsDeviceErrorLog:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody DeviceErrorLogDto dto){
|
||||
acsDeviceErrorLogService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除设备报警记录")
|
||||
@ApiOperation("删除设备报警记录")
|
||||
//@PreAuthorize("@el.check('acsDeviceErrorLog:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
acsDeviceErrorLogService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("导出设备报警记录")
|
||||
@ApiOperation("导出设备报警记录")
|
||||
@GetMapping(value = "/download")
|
||||
//@PreAuthorize("@el.check('acsDeviceErrorLog:list')")
|
||||
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||
acsDeviceErrorLogService.download(acsDeviceErrorLogService.queryAll(whereJson), response);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
|
||||
package org.nl.acs.history.service;
|
||||
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author gengby
|
||||
* @date 2023-03-15
|
||||
**/
|
||||
public interface DeviceErrorLogService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<AcsDeviceErrorLogDto>
|
||||
*/
|
||||
List<DeviceErrorLogDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param error_log_uuid ID
|
||||
* @return AcsDeviceErrorLog
|
||||
*/
|
||||
DeviceErrorLogDto findById(String error_log_uuid);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return AcsDeviceErrorLog
|
||||
*/
|
||||
DeviceErrorLogDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(DeviceErrorLogDto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(DeviceErrorLogDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param dtos 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<DeviceErrorLogDto> dtos, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.nl.acs.history.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author gengby
|
||||
* @date 2023-03-15
|
||||
**/
|
||||
@Data
|
||||
public class DeviceErrorLogDto implements Serializable {
|
||||
|
||||
/** 报警日志标识 */
|
||||
private String error_log_uuid;
|
||||
|
||||
/** 设备编码 */
|
||||
private String device_code;
|
||||
|
||||
/** 报警编码 */
|
||||
private String error_code;
|
||||
|
||||
/** 报警信息 */
|
||||
private String error_info;
|
||||
|
||||
/** 报警时间 */
|
||||
private String error_time;
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
|
||||
package org.nl.acs.history.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
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.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author gengby
|
||||
* @description 服务实现
|
||||
* @date 2023-03-15
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class DeviceErrorLogServiceImpl implements DeviceErrorLogService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
String error_code = MapUtil.getStr(whereJson, "error_code");
|
||||
String error_info = MapUtil.getStr(whereJson, "error_info");
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_device_error_log");
|
||||
String where = "1 = 1 ";
|
||||
if (StrUtil.isNotEmpty(device_code)) {
|
||||
where += "and device_code like '%" + device_code + "%'";
|
||||
}
|
||||
if (StrUtil.isNotEmpty(error_code)) {
|
||||
where += "and error_code like '%" + error_code + "%'";
|
||||
}
|
||||
if (StrUtil.isNotEmpty(error_info)) {
|
||||
where += "and error_info like '%" + error_info + "%'";
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where, "error_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceErrorLogDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_device_error_log");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
List<DeviceErrorLogDto> list = arr.toJavaList(DeviceErrorLogDto.class);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceErrorLogDto findById(String error_log_uuid) {
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_device_error_log");
|
||||
JSONObject json = wo.query("error_log_uuid ='" + error_log_uuid + "'").uniqueResult(0);
|
||||
final DeviceErrorLogDto obj = (DeviceErrorLogDto) JSONObject.toJavaObject(json, DeviceErrorLogDto.class);
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceErrorLogDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_device_error_log");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
final DeviceErrorLogDto obj = (DeviceErrorLogDto) JSONObject.toJavaObject(json, DeviceErrorLogDto.class);
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(DeviceErrorLogDto dto) {
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setError_log_uuid(IdUtil.simpleUUID());
|
||||
dto.setDevice_code(dto.getDevice_code());
|
||||
dto.setError_code(dto.getError_code());
|
||||
dto.setError_info(dto.getError_info());
|
||||
dto.setError_time(now);
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_device_error_log");
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(DeviceErrorLogDto dto) {
|
||||
DeviceErrorLogDto entity = this.findById(dto.getError_log_uuid());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_device_error_log");
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_device_error_log");
|
||||
for (String error_log_uuid : ids) {
|
||||
wo.delete("error_log_uuid = '" + error_log_uuid + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<DeviceErrorLogDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (DeviceErrorLogDto acsDeviceErrorLog : all) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("设备编码", acsDeviceErrorLog.getDevice_code());
|
||||
map.put("报警编码", acsDeviceErrorLog.getError_code());
|
||||
map.put("报警信息", acsDeviceErrorLog.getError_info());
|
||||
map.put("报警时间", acsDeviceErrorLog.getError_time());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,8 @@ public interface DictService {
|
||||
*/
|
||||
List<DictDto> queryAll(DictQueryCriteria dict);
|
||||
|
||||
List<Dict> queryAll();
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.nl.modules.system.service.impl;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.acs.history.ErrorUtil;
|
||||
import org.nl.modules.common.utils.PageUtil;
|
||||
import org.nl.modules.common.utils.QueryHelp;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
@@ -64,6 +65,8 @@ public class DictDetailServiceImpl implements DictDetailService {
|
||||
dictDetailRepository.save(resources);
|
||||
// 清理缓存
|
||||
delCaches(resources);
|
||||
Dict dict = dictRepository.findById(resources.getDict().getId()).get();
|
||||
ErrorUtil.dictMap.put(dict.getName(), this.getDictByName(dict.getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,6 +78,8 @@ public class DictDetailServiceImpl implements DictDetailService {
|
||||
dictDetailRepository.save(resources);
|
||||
// 清理缓存
|
||||
delCaches(resources);
|
||||
Dict dict = dictRepository.findById(resources.getDict().getId()).get();
|
||||
ErrorUtil.dictMap.put(dict.getName(), this.getDictByName(dict.getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,6 +95,8 @@ public class DictDetailServiceImpl implements DictDetailService {
|
||||
// 清理缓存
|
||||
delCaches(dictDetail);
|
||||
dictDetailRepository.deleteById(id);
|
||||
Dict dict = dictRepository.findById(id).get();
|
||||
ErrorUtil.dictMap.put(dict.getName(), this.getDictByName(dict.getName()));
|
||||
}
|
||||
|
||||
public void delCaches(DictDetail dictDetail){
|
||||
|
||||
@@ -60,6 +60,12 @@ public class DictServiceImpl implements DictService {
|
||||
return dictMapper.toDto(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Dict> queryAll() {
|
||||
List<Dict> list = dictRepository.findAll();
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(Dict resources) {
|
||||
|
||||
Binary file not shown.
27
wcs/nladmin-ui/src/api/acs/history/acsDeviceErrorLog.js
Normal file
27
wcs/nladmin-ui/src/api/acs/history/acsDeviceErrorLog.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/deviceErrorLog',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/deviceErrorLog/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/deviceErrorLog',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -75,25 +75,13 @@ import { get, selectDriverCodeList } from '@/api/acs/device/driverConfig'
|
||||
import { getDicts } from '@/api/system/dict'
|
||||
import standard_inspect_site from './driver/standard_inspect_site'
|
||||
import standard_ordinary_site from './driver/standard_ordinary_site'
|
||||
import weighing_site from './driver/weighing_site'
|
||||
import machines_site from './driver/machines_site'
|
||||
import lamp_three_color from './driver/lamp_three_color'
|
||||
import standard_autodoor from './driver/standard_autodoor'
|
||||
import standard_emptypallet_site from './driver/standard_emptypallet_site'
|
||||
import standard_manipulator_inspect_site from './driver/standard_manipulator_inspect_site'
|
||||
import standard_special_inspect_site from './driver/standard_special_inspect_site'
|
||||
import special_ordinary_site from './driver/special_ordinary_site'
|
||||
import standard_storage from '@/views/acs/device/driver/standard_storage'
|
||||
import standard_scanner from '@/views/acs/device/driver/standard_scanner'
|
||||
import standard_conveyor_control_with_scanner from '@/views/acs/device/driver/standard_conveyor_control_with_scanner'
|
||||
import standard_conveyor_control_with_plcscanner from '@/views/acs/device/driver/standard_conveyor_control_with_plcscanner'
|
||||
import standard_conveyor_control from '@/views/acs/device/driver/standard_conveyor_control'
|
||||
import standard_conveyor_monitor from '@/views/acs/device/driver/standard_conveyor_monitor'
|
||||
import non_line_manipulator_inspect_site from '@/views/acs/device/driver/non_line_manipulator_inspect_site'
|
||||
import non_line_inspect_site from '@/views/acs/device/driver/non_line_inspect_site'
|
||||
import manipulator_inspect_site_NDC from '@/views/acs/device/driver/manipulator_inspect_site_NDC'
|
||||
import standard_manipulator_stacking_site from '@/views/acs/device/driver/standard_manipulator_stacking_site'
|
||||
import standard_photoelectric_inspect_site from '@/views/acs/device/driver/standard_photoelectric_inspect_site'
|
||||
|
||||
import hailiang_special_pick_station from '@/views/acs/device/driver/hailiang_one/hailiang_special_pick_station'
|
||||
import hailiang_special_empty_station from '@/views/acs/device/driver/hailiang_one/hailiang_special_empty_station'
|
||||
@@ -122,18 +110,20 @@ export default {
|
||||
components: {
|
||||
standard_ordinary_site,
|
||||
standard_inspect_site,
|
||||
standard_autodoor,
|
||||
standard_storage,
|
||||
standard_scanner,
|
||||
standard_conveyor_control_with_scanner,
|
||||
standard_conveyor_control,
|
||||
standard_conveyor_monitor,
|
||||
hailiang_smart_plc_test,
|
||||
agv_ndc_two,
|
||||
agv_ndc_one,
|
||||
lamp_three_color,
|
||||
standard_emptypallet_site,
|
||||
standard_manipulator_inspect_site,
|
||||
standard_special_inspect_site,
|
||||
lamp_three_color,
|
||||
standard_storage,
|
||||
special_ordinary_site,
|
||||
standard_scanner,
|
||||
standard_conveyor_control_with_scanner,
|
||||
standard_conveyor_control_with_plcscanner,
|
||||
standard_conveyor_control,
|
||||
standard_conveyor_monitor,
|
||||
weighing_site,
|
||||
machines_site,
|
||||
non_line_manipulator_inspect_site,
|
||||
@@ -141,8 +131,6 @@ export default {
|
||||
manipulator_inspect_site_NDC,
|
||||
standard_manipulator_stacking_site,
|
||||
standard_photoelectric_inspect_site,
|
||||
agv_ndc_two,
|
||||
agv_ndc_one,
|
||||
hailiang_packer_station,
|
||||
hailiang_engraving_cache,
|
||||
hailiang_special_pick_station,
|
||||
@@ -156,12 +144,12 @@ export default {
|
||||
hailiang_cleaning_machine,
|
||||
hailiang_cleaning_machine_storage_station,
|
||||
hailiang_xj_plc_test,
|
||||
hailiang_smart_plc_test,
|
||||
hailiang_threestation_smart,
|
||||
hailiang_foldingDisc_smart,
|
||||
hailiang_elevator_wiring,
|
||||
hailiang_paint_line,
|
||||
hailiang_stacking_station
|
||||
hailiang_stacking_station,
|
||||
standard_autodoor
|
||||
},
|
||||
dicts: ['device_type'],
|
||||
mixins: [crud],
|
||||
|
||||
145
wcs/nladmin-ui/src/views/acs/history/deviceErrorInfo/index.vue
Normal file
145
wcs/nladmin-ui/src/views/acs/history/deviceErrorInfo/index.vue
Normal file
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">设备编码</label>
|
||||
<el-input
|
||||
v-model="query.device_code"
|
||||
clearable
|
||||
placeholder="设备编码"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.error_code"
|
||||
clearable
|
||||
placeholder="报警编码"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.error_info"
|
||||
clearable
|
||||
placeholder="报警信息"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<date-range-picker
|
||||
v-model="query.error_time"
|
||||
start-placeholder="error_timeStart"
|
||||
end-placeholder="error_timeStart"
|
||||
class="date-item"
|
||||
/>
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px" />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="small"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="error_code" label="报警编码" />
|
||||
<el-table-column prop="error_info" label="报警信息" />
|
||||
<el-table-column prop="error_time" label="报警时间" />
|
||||
<el-table-column
|
||||
v-permission="['admin','acsDeviceErrorLog:edit','acsDeviceErrorLog:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudAcsDeviceErrorLog from '@/api/acs/history/acsDeviceErrorLog'
|
||||
|
||||
const defaultForm = { error_log_uuid: null, device_code: null, error_code: null, error_info: null, error_time: null }
|
||||
export default {
|
||||
name: 'DeviceErrorLog',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '设备报警记录',
|
||||
url: 'api/deviceErrorLog',
|
||||
idField: 'error_log_uuid',
|
||||
sort: 'error_log_uuid,desc',
|
||||
crudMethod: { ...crudAcsDeviceErrorLog },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'deviceErrorLog:add'],
|
||||
edit: ['admin', 'deviceErrorLog:edit'],
|
||||
del: ['admin', 'adeviceErrorLog:del']
|
||||
},
|
||||
rules: {},
|
||||
queryTypeOptions: [
|
||||
{ key: 'device_code', display_name: '设备编码' },
|
||||
{ key: 'error_code', display_name: '报警编码' },
|
||||
{ key: 'error_info', display_name: '报警信息' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user