fix: 修复刻字和包装任务的bug
This commit is contained in:
@@ -44,12 +44,13 @@ public enum AcsTaskEnum {
|
|||||||
AGV_SYSTEM_NB("1","诺宝机器人任务"),
|
AGV_SYSTEM_NB("1","诺宝机器人任务"),
|
||||||
AGV_SYSTEM_XC("1","叉车任务"),
|
AGV_SYSTEM_XC("1","叉车任务"),
|
||||||
|
|
||||||
TASK_TYPE_AGV_DOUBLE_STATION("0101","AGV双工位"),
|
TASK_TYPE_NOBLE_DOUBLE_TASK("1","诺宝双工任务"),
|
||||||
TASK_TYPE_CLEANING_TASK("0102","清洗任务"),
|
TASK_TYPE_NOBLE_SINGLE_TASK("2","诺宝单工任务"),
|
||||||
TASK_TYPE_PLOTTER_FULL_OF_MATERIAL("010301","刻字满料"),
|
TASK_TYPE_NOBLE_SINGLE_ENTRY_TASK("3","诺宝单入-单任务"),
|
||||||
TASK_TYPE_PLOTTER_FILL_THE_BLANK_BOX("010302","刻字补空框"),
|
TASK_TYPE_NOBLE_DOUBLE_ENTRY_TASK("4","诺宝双入-双任务"),
|
||||||
TASK_TYPE_WARP_CALL_MATERIAL("010401","包装叫料"),
|
TASK_TYPE_NOBLE_POINT_POINT_TASK("5","诺宝点对点任务"),
|
||||||
TASK_TYPE_WARP_SEND_BLANK_BOX("010402","包装送空框"),
|
TASK_TYPE_WEIGHING_TASK_OF_PS20("6","PS20称重任务(刻字-包装)"),
|
||||||
|
TASK_TYPE_NON_WEIGHING_TASK_OF_PS20("7","PS20不称重任务(刻字-包装)"),
|
||||||
|
|
||||||
TASK_FINISHED_TYPE_AUTO("1", "自动完成任务"),
|
TASK_FINISHED_TYPE_AUTO("1", "自动完成任务"),
|
||||||
TASK_FINISHED_TYPE_MANUAL("2", "手动完成任务"),
|
TASK_FINISHED_TYPE_MANUAL("2", "手动完成任务"),
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package org.nl.system.controller.generator;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.nl.modules.common.utils.PageUtil;
|
||||||
|
import org.nl.system.service.generator.ICodeColumnConfigService;
|
||||||
|
import org.nl.system.service.generator.ICodeGenConfigService;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成字段信息存储 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/codeColumnConfig")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "系统:代码生成管理")
|
||||||
|
public class CodeColumnConfigController {
|
||||||
|
private final ICodeGenConfigService genConfigService;
|
||||||
|
private final ICodeColumnConfigService generatorService;
|
||||||
|
@Value("${generator.enabled}")
|
||||||
|
private Boolean generatorEnabled;
|
||||||
|
@ApiOperation("查询数据库数据")
|
||||||
|
@GetMapping(value = "/tables")
|
||||||
|
public ResponseEntity<Object> queryTables(@RequestParam(defaultValue = "") String name,
|
||||||
|
@RequestParam(defaultValue = "0")Integer page,
|
||||||
|
@RequestParam(defaultValue = "10")Integer size){
|
||||||
|
int[] startEnd = PageUtil.transToStartEnd(page, size);
|
||||||
|
return new ResponseEntity<>(generatorService.getTables(name,startEnd), HttpStatus.OK);
|
||||||
|
// return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package org.nl.system.controller.generator;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.nl.system.service.generator.ICodeGenConfigService;
|
||||||
|
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成器配置 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/codeGenConfig")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "系统:代码生成器配置管理")
|
||||||
|
@SaIgnore
|
||||||
|
public class CodeGenConfigController {
|
||||||
|
private final ICodeGenConfigService genConfigService;
|
||||||
|
|
||||||
|
@ApiOperation("查询")
|
||||||
|
@GetMapping(value = "/{tableName}")
|
||||||
|
public ResponseEntity<Object> query(@PathVariable String tableName){
|
||||||
|
return new ResponseEntity<>(genConfigService.find(tableName), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改")
|
||||||
|
@PutMapping
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody CodeGenConfig genConfig){
|
||||||
|
return new ResponseEntity<>(genConfigService.update(genConfig.getTableName(), genConfig),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.nl.system.service.generator;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.nl.system.service.generator.dao.CodeColumnConfig;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.system.service.generator.dto.TableInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成字段信息存储 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
public interface ICodeColumnConfigService extends IService<CodeColumnConfig> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据库元数据
|
||||||
|
* @param name 表名
|
||||||
|
* @param startEnd 分页参数
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
IPage<TableInfo> getTables(String name, int[] startEnd);
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package org.nl.system.service.generator;
|
||||||
|
|
||||||
|
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成器配置 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
public interface ICodeGenConfigService extends IService<CodeGenConfig> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据表名查找
|
||||||
|
* @param tableName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CodeGenConfig find(String tableName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据表名更新
|
||||||
|
* @param tableName
|
||||||
|
* @param genConfig
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CodeGenConfig update(String tableName, CodeGenConfig genConfig);
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package org.nl.system.service.generator.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成字段信息存储
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("code_column_config")
|
||||||
|
public class CodeColumnConfig implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "column_id", type = IdType.AUTO)
|
||||||
|
private Long columnId;
|
||||||
|
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
private String columnName;
|
||||||
|
|
||||||
|
private String columnType;
|
||||||
|
|
||||||
|
private String dictName;
|
||||||
|
|
||||||
|
private String extra;
|
||||||
|
|
||||||
|
private Boolean formShow;
|
||||||
|
|
||||||
|
private String formType;
|
||||||
|
|
||||||
|
private String keyType;
|
||||||
|
|
||||||
|
private Boolean listShow;
|
||||||
|
|
||||||
|
private Boolean notNull;
|
||||||
|
|
||||||
|
private String queryType;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
private String dateAnnotation;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package org.nl.system.service.generator.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成器配置
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("code_gen_config")
|
||||||
|
public class CodeGenConfig implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public CodeGenConfig(String tableName) {
|
||||||
|
this.tableName = tableName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "config_id", type = IdType.AUTO)
|
||||||
|
private Long configId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表名
|
||||||
|
*/
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者
|
||||||
|
*/
|
||||||
|
private String author;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否覆盖
|
||||||
|
*/
|
||||||
|
private Boolean cover;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模块名称
|
||||||
|
*/
|
||||||
|
private String moduleName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 至于哪个包下
|
||||||
|
*/
|
||||||
|
private String pack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前端代码生成的路径
|
||||||
|
*/
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前端Api文件路径
|
||||||
|
*/
|
||||||
|
private String apiPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表前缀
|
||||||
|
*/
|
||||||
|
private String prefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口名称
|
||||||
|
*/
|
||||||
|
private String apiAlias;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.nl.system.service.generator.dao.mapper;
|
||||||
|
|
||||||
|
import org.nl.system.service.generator.dao.CodeColumnConfig;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成字段信息存储 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
public interface CodeColumnConfigMapper extends BaseMapper<CodeColumnConfig> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.nl.system.service.generator.dao.mapper.CodeColumnConfigMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.nl.system.service.generator.dao.mapper;
|
||||||
|
|
||||||
|
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成器配置 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
public interface CodeGenConfigMapper extends BaseMapper<CodeGenConfig> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.nl.system.service.generator.dao.mapper.CodeGenConfigMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package org.nl.system.service.generator.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Description: 表的数据信息
|
||||||
|
* @Date: 2023/4/6
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TableInfo {
|
||||||
|
|
||||||
|
/** 表名称 */
|
||||||
|
private Object tableName;
|
||||||
|
|
||||||
|
/** 创建日期 */
|
||||||
|
private Object createTime;
|
||||||
|
|
||||||
|
/** 数据库引擎 */
|
||||||
|
private Object engine;
|
||||||
|
|
||||||
|
/** 编码集 */
|
||||||
|
private Object coding;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
private Object remark;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package org.nl.system.service.generator.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.nl.system.service.generator.dao.CodeColumnConfig;
|
||||||
|
import org.nl.system.service.generator.dao.mapper.CodeColumnConfigMapper;
|
||||||
|
import org.nl.system.service.generator.ICodeColumnConfigService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.system.service.generator.dto.TableInfo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成字段信息存储 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CodeColumnConfigServiceImpl extends ServiceImpl<CodeColumnConfigMapper, CodeColumnConfig> implements ICodeColumnConfigService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CodeColumnConfigMapper codeColumnConfigMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<TableInfo> getTables(String name, int[] startEnd) {
|
||||||
|
IPage<TableInfo> page = new Page<>();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package org.nl.system.service.generator.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.system.service.generator.ICodeGenConfigService;
|
||||||
|
import org.nl.system.service.generator.dao.CodeGenConfig;
|
||||||
|
import org.nl.system.service.generator.dao.mapper.CodeGenConfigMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 代码生成器配置 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-04-06
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CodeGenConfigServiceImpl extends ServiceImpl<CodeGenConfigMapper, CodeGenConfig> implements ICodeGenConfigService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CodeGenConfigMapper codeGenConfigMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CodeGenConfig find(String tableName) {
|
||||||
|
CodeGenConfig codeGenConfig = codeGenConfigMapper.selectOne(new LambdaQueryWrapper<CodeGenConfig>()
|
||||||
|
.eq(CodeGenConfig::getTableName, tableName));
|
||||||
|
if (ObjectUtil.isEmpty(codeGenConfig)) {
|
||||||
|
return new CodeGenConfig(tableName);
|
||||||
|
}
|
||||||
|
return codeGenConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CodeGenConfig update(String tableName, CodeGenConfig genConfig) {
|
||||||
|
// 如果 api 路径为空,则自动生成路径
|
||||||
|
if(StrUtil.isEmpty(genConfig.getApiPath())){
|
||||||
|
String separator = File.separator;
|
||||||
|
String[] paths;
|
||||||
|
String symbol = "\\";
|
||||||
|
if (symbol.equals(separator)) {
|
||||||
|
paths = genConfig.getPath().split("\\\\");
|
||||||
|
} else {
|
||||||
|
paths = genConfig.getPath().split(File.separator);
|
||||||
|
}
|
||||||
|
StringBuilder api = new StringBuilder();
|
||||||
|
for (String path : paths) {
|
||||||
|
api.append(path);
|
||||||
|
api.append(separator);
|
||||||
|
if ("src".equals(path)) {
|
||||||
|
api.append("api");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
genConfig.setApiPath(api.toString());
|
||||||
|
}
|
||||||
|
codeGenConfigMapper.updateById(genConfig);
|
||||||
|
return genConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@ public interface WmsToAcsService {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Map<String, Object> issueTaskToAcs(JSONArray arr);
|
Map<String, Object> issueTaskToAcs(JSONArray arr);
|
||||||
|
Map<String, Object> issueTaskToAcs2(JSONArray arr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WMS客户端--->ACS服务端
|
* WMS客户端--->ACS服务端
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
|||||||
TaskDto taskDto = taskService.findById(task_id);
|
TaskDto taskDto = taskService.findById(task_id);
|
||||||
String processing_class = taskDto.getHandle_class();
|
String processing_class = taskDto.getHandle_class();
|
||||||
//1:执行中,2:完成 ,3:acs取消
|
//1:执行中,2:完成 ,3:acs取消
|
||||||
String acs_task_status = row.getString("task_status");
|
String acs_task_status = row.getString("status");
|
||||||
String message = "";
|
String message = "";
|
||||||
String status = "";
|
String status = "";
|
||||||
if ("1".equals(acs_task_status)) {
|
if ("1".equals(acs_task_status)) {
|
||||||
|
|||||||
@@ -43,6 +43,28 @@ public class WmsToAcsServiceImpl implements WmsToAcsService{
|
|||||||
return AcsUtil.notifyAcs(api, form);
|
return AcsUtil.notifyAcs(api, form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> issueTaskToAcs2(JSONArray arr) {
|
||||||
|
JSONArray form = new JSONArray();
|
||||||
|
for (Object o : arr) {
|
||||||
|
JSONObject task = (JSONObject) o;
|
||||||
|
JSONObject param = new JSONObject(MapOf.of("task_id", task.getString("task_id")
|
||||||
|
, "acs_task_type", task.getString("acs_task_type")
|
||||||
|
, "task_code", task.getString("task_code")
|
||||||
|
, "start_point_code", task.getString("point_code1")//起点
|
||||||
|
, "next_point_code", task.getString("point_code2")//空盘返回点
|
||||||
|
, "task_type", task.getString("task_type")
|
||||||
|
, "priority", task.getString("priority")
|
||||||
|
, "is_send", task.getString("is_send")
|
||||||
|
, "vehicle_code", task.getString("vehicle_code")
|
||||||
|
, "agv_system_type", task.getString("agv_system_type")
|
||||||
|
));
|
||||||
|
form.add(param);
|
||||||
|
}
|
||||||
|
String api = "api/wms/task";
|
||||||
|
return AcsUtil.notifyAcs(api, form);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> cancelToAcs(JSONArray arr) {
|
public Map<String, Object> cancelToAcs(JSONArray arr) {
|
||||||
String api = "api/wms/cancelTask";
|
String api = "api/wms/cancelTask";
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
JSONArray finish = new JSONArray();
|
JSONArray finish = new JSONArray();
|
||||||
JSONObject res = new JSONObject();
|
JSONObject res = new JSONObject();
|
||||||
res.put("task_id", task_id);
|
res.put("task_id", task_id);
|
||||||
res.put("task_status", "2");
|
res.put("status", AcsTaskEnum.STATUS_FINISH.getCode());
|
||||||
res.put("finished_type", AcsTaskEnum.TASK_FINISHED_TYPE_MANUAL.getCode()); // 手动完成
|
res.put("finished_type", AcsTaskEnum.TASK_FINISHED_TYPE_MANUAL.getCode()); // 手动完成
|
||||||
finish.add(res);
|
finish.add(res);
|
||||||
acsToWmsService.receiveTaskStatusAcs(JSON.toJSONString(finish));
|
acsToWmsService.receiveTaskStatusAcs(JSON.toJSONString(finish));
|
||||||
@@ -208,7 +208,7 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
JSONArray cancel = new JSONArray();
|
JSONArray cancel = new JSONArray();
|
||||||
JSONObject res2 = new JSONObject();
|
JSONObject res2 = new JSONObject();
|
||||||
res2.put("task_id", task_id);
|
res2.put("task_id", task_id);
|
||||||
res2.put("task_status", "3");
|
res2.put("status", AcsTaskEnum.STATUS_CANNEL.getCode());
|
||||||
cancel.add(res2);
|
cancel.add(res2);
|
||||||
acsToWmsService.receiveTaskStatusAcs(JSON.toJSONString(cancel));
|
acsToWmsService.receiveTaskStatusAcs(JSON.toJSONString(cancel));
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
|
|||||||
if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
||||||
// 执行中
|
// 执行中
|
||||||
// 任务执行中
|
// 任务执行中
|
||||||
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
taskObj.put("task_status", StatusEnum.TASK_RUNNING.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
||||||
@@ -84,6 +84,8 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
|
|||||||
// 2任务取消
|
// 2任务取消
|
||||||
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
|
taskObj.put("finished_type", ObjectUtil.isNotEmpty(task.getString("finished_type"))?
|
||||||
|
task.getString("finished_type"):AcsTaskEnum.TASK_FINISHED_TYPE_AUTO.getCode());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,7 +95,7 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
|
|||||||
public String createTask(JSONObject param) {
|
public String createTask(JSONObject param) {
|
||||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_produce_workOrder");
|
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_produce_workOrder");
|
||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
String end_point_code = param.getString("point_code"); // todo
|
String end_point_code = param.getString("device_code");
|
||||||
String workorder = param.getString("workorder_code");
|
String workorder = param.getString("workorder_code");
|
||||||
if(StrUtil.isEmpty(end_point_code)) {
|
if(StrUtil.isEmpty(end_point_code)) {
|
||||||
throw new BadRequestException("终点不能为空!");
|
throw new BadRequestException("终点不能为空!");
|
||||||
@@ -119,7 +121,7 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
|
|||||||
task.put("task_id", taskdtl_id);
|
task.put("task_id", taskdtl_id);
|
||||||
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||||
task.put("task_name", "刻字机呼叫空框");
|
task.put("task_name", "刻字机呼叫空框");
|
||||||
task.put("task_type", AcsTaskEnum.TASK_TYPE_PLOTTER_FILL_THE_BLANK_BOX.getCode()); // todo: 未知
|
task.put("task_type", AcsTaskEnum.TASK_TYPE_NON_WEIGHING_TASK_OF_PS20.getCode()); // todo: 未知????????
|
||||||
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
|
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
|
||||||
task.put("material_id", workOrderObj.getString("material_id"));
|
task.put("material_id", workOrderObj.getString("material_id"));
|
||||||
task.put("point_code2", end_point_code);
|
task.put("point_code2", end_point_code);
|
||||||
@@ -133,6 +135,7 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
|
|||||||
task.put("create_time", DateUtil.now());
|
task.put("create_time", DateUtil.now());
|
||||||
task.put("update_time", DateUtil.now());
|
task.put("update_time", DateUtil.now());
|
||||||
task.put("priority", "1");
|
task.put("priority", "1");
|
||||||
|
task.put("agv_system_type", "2");
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
||||||
// 找终点
|
// 找终点
|
||||||
try {
|
try {
|
||||||
@@ -141,7 +144,7 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
|
|||||||
JSONObject result = taskTab.query("task_id = '" + taskdtl_id + "'").uniqueResult(0);
|
JSONObject result = taskTab.query("task_id = '" + taskdtl_id + "'").uniqueResult(0);
|
||||||
data.add(result);
|
data.add(result);
|
||||||
// 下发
|
// 下发
|
||||||
wms.issueTaskToAcs(data);
|
wms.issueTaskToAcs2(data);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// 未找到
|
// 未找到
|
||||||
task.put("remark", ex.getMessage());
|
task.put("remark", ex.getMessage());
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
|
|||||||
if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
||||||
// 执行中
|
// 执行中
|
||||||
// 任务执行中
|
// 任务执行中
|
||||||
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
taskObj.put("task_status", StatusEnum.TASK_RUNNING.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
||||||
@@ -59,7 +59,7 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
|
|||||||
// 释放点位并赋值
|
// 释放点位并赋值
|
||||||
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
|
pointObj.put("lock_type", StatusEnum.LOCK_OFF.getCode());
|
||||||
pointObj.put("point_status", StatusEnum.POINT_STATUS_EMPTY.getCode());
|
pointObj.put("point_status", StatusEnum.POINT_STATUS_EMPTY.getCode());
|
||||||
pointObj.put("material_id", "");
|
pointObj.put("material_id", taskObj.getString("material_id"));
|
||||||
pointObj.put("update_time", DateUtil.now());
|
pointObj.put("update_time", DateUtil.now());
|
||||||
pointTab.update(pointObj);
|
pointTab.update(pointObj);
|
||||||
}
|
}
|
||||||
@@ -85,6 +85,8 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
|
|||||||
// 2任务取消
|
// 2任务取消
|
||||||
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
|
taskObj.put("finished_type", ObjectUtil.isNotEmpty(task.getString("finished_type"))?
|
||||||
|
task.getString("finished_type"):AcsTaskEnum.TASK_FINISHED_TYPE_AUTO.getCode());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,7 +96,7 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
|
|||||||
public String createTask(JSONObject param) {
|
public String createTask(JSONObject param) {
|
||||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_produce_workOrder");
|
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_produce_workOrder");
|
||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
String end_point_code = param.getString("point_code"); // todo
|
String end_point_code = param.getString("device_code");
|
||||||
String workorder = param.getString("workorder_code");
|
String workorder = param.getString("workorder_code");
|
||||||
if(StrUtil.isEmpty(end_point_code)) {
|
if(StrUtil.isEmpty(end_point_code)) {
|
||||||
throw new BadRequestException("终点不能为空!");
|
throw new BadRequestException("终点不能为空!");
|
||||||
@@ -118,7 +120,7 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
|
|||||||
task.put("task_id", taskdtl_id);
|
task.put("task_id", taskdtl_id);
|
||||||
task.put("task_name", "包装叫料");
|
task.put("task_name", "包装叫料");
|
||||||
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||||
task.put("task_type", AcsTaskEnum.TASK_TYPE_WARP_CALL_MATERIAL.getCode()); // todo: 未知
|
task.put("task_type", AcsTaskEnum.TASK_TYPE_NON_WEIGHING_TASK_OF_PS20.getCode()); // todo: 未知
|
||||||
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
|
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
|
||||||
task.put("point_code2", end_point_code);
|
task.put("point_code2", end_point_code);
|
||||||
task.put("handle_class", this.getClass().getName());
|
task.put("handle_class", this.getClass().getName());
|
||||||
@@ -131,6 +133,7 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
|
|||||||
task.put("create_time", DateUtil.now());
|
task.put("create_time", DateUtil.now());
|
||||||
task.put("update_time", DateUtil.now());
|
task.put("update_time", DateUtil.now());
|
||||||
task.put("priority", "1");
|
task.put("priority", "1");
|
||||||
|
task.put("agv_system_type", "2");
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
||||||
// 找终点
|
// 找终点
|
||||||
try {
|
try {
|
||||||
@@ -139,7 +142,7 @@ public class WrapCallMaterialTask extends AbstractAcsTask {
|
|||||||
JSONObject result = taskTab.query("task_id = '" + taskdtl_id + "'").uniqueResult(0);
|
JSONObject result = taskTab.query("task_id = '" + taskdtl_id + "'").uniqueResult(0);
|
||||||
data.add(result);
|
data.add(result);
|
||||||
// 下发
|
// 下发
|
||||||
wms.issueTaskToAcs(data);
|
wms.issueTaskToAcs2(data);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// 未找到
|
// 未找到
|
||||||
task.put("remark", ex.getMessage());
|
task.put("remark", ex.getMessage());
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
|
|||||||
if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
||||||
// 执行中
|
// 执行中
|
||||||
// 任务执行中
|
// 任务执行中
|
||||||
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
taskObj.put("task_status", StatusEnum.TASK_RUNNING.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
||||||
@@ -83,16 +83,16 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
|
|||||||
// 2任务取消
|
// 2任务取消
|
||||||
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
|
taskObj.put("finished_type", ObjectUtil.isNotEmpty(task.getString("finished_type"))?
|
||||||
|
task.getString("finished_type"):AcsTaskEnum.TASK_FINISHED_TYPE_AUTO.getCode());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String createTask(JSONObject param) {
|
public String createTask(JSONObject param) {
|
||||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_produce_workOrder");
|
|
||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
String start_point_code = param.getString("point_code"); // todo
|
String start_point_code = param.getString("device_code");
|
||||||
String workorder = param.getString("workorder_code");
|
|
||||||
if(StrUtil.isEmpty(start_point_code)) {
|
if(StrUtil.isEmpty(start_point_code)) {
|
||||||
throw new BadRequestException("起点不能为空!");
|
throw new BadRequestException("起点不能为空!");
|
||||||
}
|
}
|
||||||
@@ -103,18 +103,12 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
|
|||||||
if (ObjectUtil.isNotEmpty(taskObj)) {
|
if (ObjectUtil.isNotEmpty(taskObj)) {
|
||||||
throw new BadRequestException("当前点位" + start_point_code + "存在未完成的任务");
|
throw new BadRequestException("当前点位" + start_point_code + "存在未完成的任务");
|
||||||
}
|
}
|
||||||
// todo: 判断工单?
|
|
||||||
// 判断工单
|
|
||||||
// JSONObject workOrderObj = workOrderTab.query("workorder_code <> '" + workorder + "' and workorder_status = '" + StatusEnum.TASK_FINISH.getCode() + "' and is_delete ='0'").uniqueResult(0);
|
|
||||||
// if (ObjectUtil.isEmpty(workOrderObj)){
|
|
||||||
// throw new BadRequestException("下发工单不存在未完成工单:"+workorder);
|
|
||||||
// }
|
|
||||||
String taskdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
String taskdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||||
JSONObject task = new JSONObject();
|
JSONObject task = new JSONObject();
|
||||||
task.put("task_id", taskdtl_id);
|
task.put("task_id", taskdtl_id);
|
||||||
task.put("task_name", "包装送空框");
|
task.put("task_name", "包装送空框");
|
||||||
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||||
task.put("task_type", AcsTaskEnum.TASK_TYPE_WARP_SEND_BLANK_BOX.getCode()); // todo: 未知
|
task.put("task_type", AcsTaskEnum.TASK_TYPE_NON_WEIGHING_TASK_OF_PS20.getCode()); // todo: 未知
|
||||||
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
|
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
|
||||||
task.put("point_code1", start_point_code);
|
task.put("point_code1", start_point_code);
|
||||||
task.put("handle_class", this.getClass().getName());
|
task.put("handle_class", this.getClass().getName());
|
||||||
@@ -127,6 +121,7 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
|
|||||||
task.put("create_time", DateUtil.now());
|
task.put("create_time", DateUtil.now());
|
||||||
task.put("update_time", DateUtil.now());
|
task.put("update_time", DateUtil.now());
|
||||||
task.put("priority", "1");
|
task.put("priority", "1");
|
||||||
|
task.put("agv_system_type", "2");
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
||||||
// 找终点
|
// 找终点
|
||||||
try {
|
try {
|
||||||
@@ -135,7 +130,7 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
|
|||||||
JSONObject result = taskTab.query("task_id = '" + taskdtl_id + "'").uniqueResult(0);
|
JSONObject result = taskTab.query("task_id = '" + taskdtl_id + "'").uniqueResult(0);
|
||||||
data.add(result);
|
data.add(result);
|
||||||
// 下发
|
// 下发
|
||||||
wms.issueTaskToAcs(data);
|
wms.issueTaskToAcs2(data);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// 未找到
|
// 未找到
|
||||||
task.put("remark", ex.getMessage());
|
task.put("remark", ex.getMessage());
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
|
|||||||
if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
||||||
// 执行中
|
// 执行中
|
||||||
// 任务执行中
|
// 任务执行中
|
||||||
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
taskObj.put("task_status", StatusEnum.TASK_RUNNING.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
} else if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
||||||
@@ -85,6 +85,8 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
|
|||||||
// 2任务取消
|
// 2任务取消
|
||||||
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
taskObj.put("task_status", StatusEnum.TASK_CANNEL.getCode());
|
||||||
taskObj.put("update_time", DateUtil.now());
|
taskObj.put("update_time", DateUtil.now());
|
||||||
|
taskObj.put("finished_type", ObjectUtil.isNotEmpty(task.getString("finished_type"))?
|
||||||
|
task.getString("finished_type"):AcsTaskEnum.TASK_FINISHED_TYPE_AUTO.getCode());
|
||||||
taskTab.update(taskObj);
|
taskTab.update(taskObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,7 +96,7 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
|
|||||||
public String createTask(JSONObject param) {
|
public String createTask(JSONObject param) {
|
||||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_produce_workOrder");
|
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_produce_workOrder");
|
||||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
String start_point_code = param.getString("point_code"); // todo
|
String start_point_code = param.getString("device_code");
|
||||||
String workorder = param.getString("workorder_code");
|
String workorder = param.getString("workorder_code");
|
||||||
if(StrUtil.isEmpty(start_point_code)) {
|
if(StrUtil.isEmpty(start_point_code)) {
|
||||||
throw new BadRequestException("起点不能为空!");
|
throw new BadRequestException("起点不能为空!");
|
||||||
@@ -120,7 +122,7 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
|
|||||||
task.put("task_id", taskdtl_id);
|
task.put("task_id", taskdtl_id);
|
||||||
task.put("task_name", "刻字机送料");
|
task.put("task_name", "刻字机送料");
|
||||||
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||||
task.put("task_type", AcsTaskEnum.TASK_TYPE_PLOTTER_FULL_OF_MATERIAL.getCode()); // todo: 未知
|
task.put("task_type", AcsTaskEnum.TASK_TYPE_WEIGHING_TASK_OF_PS20.getCode()); // todo: 未知
|
||||||
task.put("material_id", workOrderObj.getString("material_id"));
|
task.put("material_id", workOrderObj.getString("material_id"));
|
||||||
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
|
task.put("task_status", StatusEnum.TASK_CREATE.getCode());
|
||||||
task.put("point_code1", start_point_code);
|
task.put("point_code1", start_point_code);
|
||||||
@@ -134,6 +136,7 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
|
|||||||
task.put("create_time", DateUtil.now());
|
task.put("create_time", DateUtil.now());
|
||||||
task.put("update_time", DateUtil.now());
|
task.put("update_time", DateUtil.now());
|
||||||
task.put("priority", "1");
|
task.put("priority", "1");
|
||||||
|
task.put("agv_system_type", "2");
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
WQLObject.getWQLObject("SCH_BASE_Task").insert(task);
|
||||||
// 找终点
|
// 找终点
|
||||||
try {
|
try {
|
||||||
@@ -142,7 +145,7 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
|
|||||||
JSONObject result = taskTab.query("task_id = '" + taskdtl_id + "'").uniqueResult(0);
|
JSONObject result = taskTab.query("task_id = '" + taskdtl_id + "'").uniqueResult(0);
|
||||||
data.add(result);
|
data.add(result);
|
||||||
// 下发
|
// 下发
|
||||||
wms.issueTaskToAcs(data);
|
wms.issueTaskToAcs2(data);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// 未找到
|
// 未找到
|
||||||
task.put("remark", ex.getMessage());
|
task.put("remark", ex.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user