fix: 对照马钢LMS修复物料、组盘、抽象任务类
This commit is contained in:
@@ -405,7 +405,7 @@
|
||||
<artifactId>commons-configuration</artifactId>
|
||||
<version>${configuration.version}</version>
|
||||
</dependency>
|
||||
<!-- ****************** -->
|
||||
<!-- JetCache -->
|
||||
<dependency>
|
||||
<groupId>com.alicp.jetcache</groupId>
|
||||
<artifactId>jetcache-starter-redis</artifactId>
|
||||
|
||||
@@ -17,9 +17,9 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "物料基础信息管理")
|
||||
|
||||
@@ -10,35 +10,37 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
* @description 服务接口
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
public interface IMdBaseMaterialService extends IService<MdBaseMaterial> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<MdBaseMaterial>
|
||||
*/
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<MdBaseMaterial>
|
||||
*/
|
||||
IPage<MdBaseMaterial> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param entity /
|
||||
*/
|
||||
* 创建
|
||||
* @param entity /
|
||||
*/
|
||||
void create(MdBaseMaterial entity);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param entity /
|
||||
*/
|
||||
* 编辑
|
||||
* @param entity /
|
||||
*/
|
||||
void update(MdBaseMaterial entity);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
|
||||
MdBaseMaterial findByCode(String materialCode);
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_base_material")
|
||||
@@ -26,9 +26,15 @@ public class MdBaseMaterial implements Serializable {
|
||||
@ApiModelProperty(value = "物料标识")
|
||||
private String material_id;
|
||||
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
@ApiModelProperty(value = "成品物料编码")
|
||||
private String material_code;
|
||||
|
||||
@ApiModelProperty(value = "半成品物料编码")
|
||||
private String half_material_code;
|
||||
|
||||
@ApiModelProperty(value = "原材料物料编码")
|
||||
private String raw_material_code;
|
||||
|
||||
@ApiModelProperty(value = "物料名称 ")
|
||||
private String material_name;
|
||||
|
||||
@@ -39,7 +45,10 @@ public class MdBaseMaterial implements Serializable {
|
||||
private String class_id;
|
||||
|
||||
@ApiModelProperty(value = "静置时间(分钟)")
|
||||
private BigDecimal standing_time;
|
||||
private Integer standing_time;
|
||||
|
||||
@ApiModelProperty(value = "冷却时间(分钟)")
|
||||
private Integer cooling_time;
|
||||
|
||||
@ApiModelProperty(value = "车间编码")
|
||||
private String workshop_code;
|
||||
|
||||
@@ -5,10 +5,10 @@ import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
@Data
|
||||
public class MdBaseMaterialDto implements Serializable {
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@ package org.nl.wms.database.material.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -17,16 +19,17 @@ import org.nl.wms.database.material.service.dao.mapper.MdBaseMaterialMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2023-05-05
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MdBaseMaterialServiceImpl extends ServiceImpl<MdBaseMaterialMapper, MdBaseMaterial> implements IMdBaseMaterialService {
|
||||
@@ -37,11 +40,14 @@ public class MdBaseMaterialServiceImpl extends ServiceImpl<MdBaseMaterialMapper,
|
||||
@Override
|
||||
public IPage<MdBaseMaterial> queryAll(Map whereJson, PageQuery page){
|
||||
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
|
||||
Boolean is_used = ObjectUtil.isNotEmpty(whereJson.get("is_used")) ? Boolean.valueOf(whereJson.get("is_used").toString()) : null;
|
||||
String workshop_code = ObjectUtil.isNotEmpty(whereJson.get("workshop_code")) ? whereJson.get("workshop_code").toString() : null;
|
||||
Boolean is_used = ObjectUtil.isNotEmpty(whereJson.get("is_used"))
|
||||
? Boolean.valueOf(whereJson.get("is_used").toString()) : null;
|
||||
String workshop_code = ObjectUtil.isNotEmpty(whereJson.get("workshop_code"))
|
||||
? whereJson.get("workshop_code").toString() : null;
|
||||
LambdaQueryWrapper<MdBaseMaterial> lam = new LambdaQueryWrapper<>();
|
||||
lam.like(ObjectUtil.isNotEmpty(blurry), MdBaseMaterial::getMaterial_code, blurry)
|
||||
.or(ObjectUtil.isNotEmpty(blurry), l -> l.like(ObjectUtil.isNotEmpty(blurry), MdBaseMaterial::getMaterial_name, blurry))
|
||||
.or(ObjectUtil.isNotEmpty(blurry),
|
||||
l -> l.like(ObjectUtil.isNotEmpty(blurry), MdBaseMaterial::getMaterial_name, blurry))
|
||||
.eq(ObjectUtil.isNotEmpty(is_used), MdBaseMaterial::getIs_used, is_used)
|
||||
.eq(ObjectUtil.isNotEmpty(workshop_code), MdBaseMaterial::getWorkshop_code, workshop_code);
|
||||
IPage<MdBaseMaterial> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
@@ -86,4 +92,12 @@ public class MdBaseMaterialServiceImpl extends ServiceImpl<MdBaseMaterialMapper,
|
||||
mdBaseMaterialMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MdBaseMaterial findByCode(String materialCode) {
|
||||
QueryWrapper<MdBaseMaterial> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda().eq(MdBaseMaterial::getMaterial_code, materialCode).eq(MdBaseMaterial::getIs_used, true);
|
||||
List<MdBaseMaterial> mdBaseMaterials = mdBaseMaterialMapper.selectList(wrapper);
|
||||
return mdBaseMaterials.size() > 0 ? mdBaseMaterials.get(0) : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.wms.pda.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.system.service.secutiry.dto.AuthUserDto;
|
||||
import org.nl.wms.pda.service.PdaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 手持接口
|
||||
* @Date: 2023/8/1
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "手持接口")
|
||||
@RequestMapping("/api/pda")
|
||||
public class PdaController {
|
||||
@Autowired
|
||||
private PdaService pdaService;
|
||||
@SaIgnore
|
||||
@ApiOperation("登录授权")
|
||||
@PostMapping(value = "/login")
|
||||
public JSONObject login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
||||
return pdaService.login(authUser, request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.wms.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.system.service.secutiry.dto.AuthUserDto;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/8/17
|
||||
*/
|
||||
public interface PdaService {
|
||||
JSONObject login(AuthUserDto authUser, HttpServletRequest request);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.nl.wms.pda.service.dao.mapper;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 手持mapper接口
|
||||
* @Date: 2023/8/1
|
||||
*/
|
||||
public interface PdaMapper {
|
||||
}
|
||||
@@ -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.wms.pda.service.dao.mapper.PdaMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.pda.service.dao.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 下拉框数据
|
||||
* @Date: 2023/8/1
|
||||
*/
|
||||
@Data
|
||||
public class DropdownListVo implements Serializable {
|
||||
private String value;
|
||||
private String text;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.pda.service.dao.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 手持返回
|
||||
* @Date: 2023/8/3
|
||||
*/
|
||||
@Data
|
||||
public class PdaResponseVo {
|
||||
// 先提供一个message
|
||||
private String message;
|
||||
|
||||
public static PdaResponseVo pdaResultOk(String message) {
|
||||
PdaResponseVo vo = new PdaResponseVo();
|
||||
vo.setMessage(message);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package org.nl.wms.pda.service.impl;
|
||||
|
||||
import cn.dev33.satoken.secure.SaSecureUtil;
|
||||
import cn.dev33.satoken.stp.SaLoginModel;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.RsaUtils;
|
||||
import org.nl.common.utils.dto.CurrentUser;
|
||||
import org.nl.config.RsaProperties;
|
||||
import org.nl.system.service.role.ISysRoleService;
|
||||
import org.nl.system.service.secutiry.dto.AuthUserDto;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.system.service.user.dao.SysUser;
|
||||
import org.nl.wms.pda.service.PdaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2023/8/17
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PdaServiceImpl implements PdaService {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private ISysRoleService roleService;
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public JSONObject login(AuthUserDto authUser, HttpServletRequest request) {
|
||||
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
|
||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
|
||||
// 校验数据库
|
||||
// 根据用户名查询,在比对密码
|
||||
SysUser userInfo = userService.getOne(new LambdaQueryWrapper<SysUser>()
|
||||
.eq(SysUser::getUsername, authUser.getUsername())); // 拿不到已经抛出异常
|
||||
if (!userInfo.getPassword().equals(SaSecureUtil.md5BySalt(password, "salt"))) { // 这里需要密码加密
|
||||
throw new BadRequestException("账号或密码错误!");
|
||||
}
|
||||
// 获取权限列表 - 登录查找权限
|
||||
List<String> permissionList = roleService.getPermissionList((JSONObject) JSON.toJSON(userInfo));
|
||||
|
||||
if (!userInfo.getIs_used()) {
|
||||
throw new BadRequestException("账号未激活");
|
||||
}
|
||||
|
||||
// 登录输入,登出删除
|
||||
CurrentUser user = new CurrentUser();
|
||||
user.setId(userInfo.getUser_id());
|
||||
user.setUsername(userInfo.getUsername());
|
||||
user.setPresonName(userInfo.getPerson_name());
|
||||
user.setUser(userInfo);
|
||||
user.setPermissions(permissionList);
|
||||
|
||||
// SaLoginModel 配置登录相关参数
|
||||
StpUtil.login(userInfo.getUser_id(), new SaLoginModel()
|
||||
.setDevice("PE") // 此次登录的客户端设备类型, 用于[同端互斥登录]时指定此次登录的设备类型
|
||||
.setExtra("loginInfo", user) // Token挂载的扩展参数 (此方法只有在集成jwt插件时才会生效)
|
||||
);
|
||||
|
||||
// 返回 token 与 用户信息
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("user", userInfo);
|
||||
JSONObject authInfo = new JSONObject(2) {{
|
||||
put("token", "Bearer " + StpUtil.getTokenValue());
|
||||
put("user", jsonObject);
|
||||
}};
|
||||
|
||||
return authInfo;
|
||||
}
|
||||
}
|
||||
@@ -17,14 +17,14 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "任务配置管理")
|
||||
@RequestMapping("/api/schBaseTaskconfig")
|
||||
public class SchBaseTaskconfigController {
|
||||
public class SchBaseTaskConfigController {
|
||||
|
||||
@Autowired
|
||||
private ISchBaseTaskconfigService schBaseTaskconfigService;
|
||||
@@ -21,9 +21,9 @@ import sun.security.krb5.internal.PAData;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "任务管理管理")
|
||||
@@ -77,16 +77,6 @@ public class SchBaseTaskController {
|
||||
return new ResponseEntity<>(TableDataInfo.build(schBaseTaskService.getTaskStatusList()),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/apply")
|
||||
@Log("新增任务管理")
|
||||
@ApiOperation("新增任务管理")
|
||||
//@SaCheckPermission("@el.check('schBaseTask:add')")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> apply(@RequestBody Map param){
|
||||
schBaseTaskService.apply(JSONObject.parseObject(JSON.toJSONString(param)));
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping("/operation")
|
||||
@Log("任务操作")
|
||||
@ApiOperation("任务操作")
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
||||
|
||||
@@ -82,7 +83,7 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 任务申请
|
||||
*
|
||||
* @see BaseRequest
|
||||
* @param param /
|
||||
*/
|
||||
void apply(JSONObject param);
|
||||
@@ -99,4 +100,6 @@ public interface ISchBaseTaskService extends IService<SchBaseTask> {
|
||||
* @param param
|
||||
*/
|
||||
void operation(Map<String, Object> param);
|
||||
|
||||
SchBaseTask getByCode(String taskCode);
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sch_base_task")
|
||||
@@ -22,7 +22,10 @@ public class SchBaseTask implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "task_code", type = IdType.NONE)
|
||||
@TableId(value = "task_id", type = IdType.NONE)
|
||||
@ApiModelProperty(value = "任务标识")
|
||||
private String task_id;
|
||||
|
||||
@ApiModelProperty(value = "任务编码")
|
||||
private String task_code;
|
||||
|
||||
@@ -45,15 +48,20 @@ public class SchBaseTask implements Serializable {
|
||||
@ApiModelProperty(value = "点位4")
|
||||
private String point_code4;
|
||||
|
||||
@ApiModelProperty(value = "组盘标识")
|
||||
private String group_id;
|
||||
|
||||
@ApiModelProperty(value = "载具类型")
|
||||
private String vehicle_type;
|
||||
|
||||
@ApiModelProperty(value = "载具数量")
|
||||
private BigDecimal vehicle_qty;
|
||||
private Integer vehicle_qty;
|
||||
|
||||
@ApiModelProperty(value = "载具编码")
|
||||
private String vehicle_code;
|
||||
|
||||
@ApiModelProperty(value = "载具编码2")
|
||||
private String vehicle_code2;
|
||||
|
||||
@ApiModelProperty(value = "处理状态")
|
||||
private String handle_status;
|
||||
|
||||
@@ -13,10 +13,10 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sch_base_taskconfig")
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
package org.nl.wms.sch.task.service.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
@Data
|
||||
public class SchBaseTaskDto implements Serializable {
|
||||
|
||||
/** 任务标识 */
|
||||
private String task_id;
|
||||
|
||||
/** 任务编码 */
|
||||
private String task_code;
|
||||
|
||||
@@ -34,6 +39,9 @@ public class SchBaseTaskDto implements Serializable {
|
||||
/** 点位4 */
|
||||
private String point_code4;
|
||||
|
||||
@ApiModelProperty(value = "组盘标识")
|
||||
private String group_id;
|
||||
|
||||
/** 载具类型 */
|
||||
private String vehicle_type;
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2023-05-15
|
||||
**/
|
||||
@Data
|
||||
public class SchBaseTaskconfigDto implements Serializable {
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
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 com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -49,13 +50,20 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
|
||||
@Override
|
||||
public IPage<SchBaseTask> queryAll(Map whereJson, PageQuery page) {
|
||||
String task_code = ObjectUtil.isNotEmpty(whereJson.get("task_code")) ? whereJson.get("task_code").toString() : null;
|
||||
String vehicle_code = ObjectUtil.isNotEmpty(whereJson.get("vehicle_code")) ? whereJson.get("vehicle_code").toString() : null;
|
||||
String point_code = ObjectUtil.isNotEmpty(whereJson.get("point_code")) ? whereJson.get("point_code").toString() : null;
|
||||
String begin_time = ObjectUtil.isNotEmpty(whereJson.get("begin_time")) ? whereJson.get("begin_time").toString() : null;
|
||||
String end_time = ObjectUtil.isNotEmpty(whereJson.get("end_time")) ? whereJson.get("end_time").toString() : null;
|
||||
String more_task_status = ObjectUtil.isNotEmpty(whereJson.get("more_task_status")) ? whereJson.get("more_task_status").toString() : null;
|
||||
List<String> collect = ObjectUtil.isNotEmpty(more_task_status)?Arrays.stream(more_task_status.split(",")).collect(Collectors.toList()):null;
|
||||
String task_code = ObjectUtil.isNotEmpty(whereJson.get("task_code"))
|
||||
? whereJson.get("task_code").toString() : null;
|
||||
String vehicle_code = ObjectUtil.isNotEmpty(whereJson.get("vehicle_code"))
|
||||
? whereJson.get("vehicle_code").toString() : null;
|
||||
String point_code = ObjectUtil.isNotEmpty(whereJson.get("point_code"))
|
||||
? whereJson.get("point_code").toString() : null;
|
||||
String begin_time = ObjectUtil.isNotEmpty(whereJson.get("begin_time"))
|
||||
? whereJson.get("begin_time").toString() : null;
|
||||
String end_time = ObjectUtil.isNotEmpty(whereJson.get("end_time"))
|
||||
? whereJson.get("end_time").toString() : null;
|
||||
String more_task_status = ObjectUtil.isNotEmpty(whereJson.get("more_task_status"))
|
||||
? whereJson.get("more_task_status").toString() : null;
|
||||
List<String> collect = ObjectUtil.isNotEmpty(more_task_status)
|
||||
? Arrays.stream(more_task_status.split(",")).collect(Collectors.toList()) : null;
|
||||
String unFinished = null;
|
||||
if (collect != null) {
|
||||
if (collect.contains(TaskStatus.UNFINISHED.getCode())) {
|
||||
@@ -116,8 +124,8 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
LambdaQueryWrapper<SchBaseTask> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(SchBaseTask::getConfig_code, config_code)
|
||||
.lt(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode())
|
||||
.ne(SchBaseTask::getTask_code, task_code)
|
||||
.ne(SchBaseTask::getIs_delete, true);
|
||||
.ne(SchBaseTask::getTask_code, task_code) // 不是当前任务
|
||||
.eq(SchBaseTask::getIs_delete, false);
|
||||
List<SchBaseTask> schBaseTasks = schBaseTaskMapper.selectList(lam);
|
||||
return schBaseTasks;
|
||||
}
|
||||
@@ -125,6 +133,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
@Override
|
||||
public List<SchBaseTask> findUnFinishTasksByTaskConfig(String config_code, String device_code, String direction) {
|
||||
Assert.notNull(config_code, "任务配置编码不能为空!");
|
||||
Assert.notNull(direction, "任务配置编置的方向不能为空!");
|
||||
LambdaQueryWrapper<SchBaseTask> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(SchBaseTask::getConfig_code, config_code)
|
||||
.lt(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode())
|
||||
@@ -154,6 +163,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
String now = DateUtil.now();
|
||||
Assert.notNull(entity.getTask_status(), "任务状态不能为空!");
|
||||
|
||||
entity.setTask_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setCreate_id(currentUserId);
|
||||
entity.setCreate_name(nickName);
|
||||
@@ -169,27 +179,11 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
public void apply(JSONObject param) {
|
||||
/**
|
||||
* 参数:设备编号(确定的点), 任务类型, 载具编码
|
||||
* hint: 根据任务类型来判断校验
|
||||
*/
|
||||
String device_code = ObjectUtil.isNotEmpty(param.getString("device_code")) ? param.getString("device_code") : null;
|
||||
String type = ObjectUtil.isNotEmpty(param.getString("type")) ? param.getString("type") : null;
|
||||
String vehicle_code = ObjectUtil.isNotEmpty(param.getString("vehicle_code")) ? param.getString("vehicle_code") : null;
|
||||
String vehicle_qty = ObjectUtil.isNotEmpty(param.getString("vehicle_qty")) ? param.getString("vehicle_qty") : null;
|
||||
String configCode = param.getString("config_code");
|
||||
// 校验设备编码
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
throw new BadRequestException("设备编码不能为空!");
|
||||
}
|
||||
//1、如果是送料,检测载具状态
|
||||
if (type.equals("1") && ObjectUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("载具编码不能为空!");
|
||||
}
|
||||
//2、送空载具
|
||||
//...
|
||||
//3、叫料
|
||||
//...
|
||||
//4、叫空载具
|
||||
//...
|
||||
AbstractTask task = taskFactory.getTask(configCode); //"HNMLTask"
|
||||
AbstractTask task = taskFactory.getTask(configCode);
|
||||
// 执行创建任务
|
||||
task.apply(param);
|
||||
}
|
||||
@@ -211,13 +205,17 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
public void operation(Map<String, Object> param) {
|
||||
String task_code = ObjectUtil.isNotEmpty(param.get("task_code")) ? param.get("task_code").toString() : null;
|
||||
String method_name = ObjectUtil.isNotEmpty(param.get("method_name")) ? param.get("method_name").toString() : null;
|
||||
String config_code = ObjectUtil.isNotEmpty(param.get("config_code")) ? param.get("config_code").toString() : null;
|
||||
if (ObjectUtil.isEmpty(task_code) || ObjectUtil.isEmpty(method_name) || ObjectUtil.isEmpty(config_code)) {
|
||||
throw new BadRequestException("操作失败");
|
||||
}
|
||||
// 根据标识找到任务
|
||||
SchBaseTask taskOne = schBaseTaskMapper.selectById(task_code);
|
||||
SchBaseTask taskOne = this.getByCode(task_code);
|
||||
if (Integer.parseInt(taskOne.getTask_status()) >= Integer.parseInt(TaskStatus.FINISHED.getCode())) {
|
||||
throw new BadRequestException("任务已完成或已取消!");
|
||||
}
|
||||
// 根据配置去工厂类获得类对象
|
||||
String processing_class = "HNMLTask";
|
||||
String processing_class = config_code;
|
||||
String message = "";
|
||||
// 根据任务类型获取对应的任务操作类
|
||||
AbstractTask abstractTask = taskFactory.getTask(processing_class);
|
||||
@@ -238,4 +236,11 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SchBaseTask getByCode(String taskCode) {
|
||||
LambdaQueryWrapper<SchBaseTask> lam = new QueryWrapper<SchBaseTask>().lambda();
|
||||
lam.eq(SchBaseTask::getTask_code, taskCode);
|
||||
return this.getOne(lam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
package org.nl.wms.sch.task_manage;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.ext.acs.service.dto.to.wms.AcsResponse;
|
||||
import org.nl.wms.ext.record.service.ISysInteractRecordService;
|
||||
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
@@ -14,20 +22,23 @@ import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||
import org.nl.wms.sch.task_manage.enums.TaskDirectionEnum;
|
||||
import org.nl.wms.sch.task_manage.task.AcsUtil;
|
||||
import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum;
|
||||
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
||||
import org.nl.wms.util.TaskUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年05月16日 16:42
|
||||
* @desc desc
|
||||
* @desc 任务抽象父类,申请任务的相关率先判断以及生成,接着到子类执行任务的创建,最后统一通过定时任务去下发到ACS
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public abstract class AbstractTask {
|
||||
@Autowired
|
||||
@@ -38,6 +49,10 @@ public abstract class AbstractTask {
|
||||
private ISchBasePointService pointService;
|
||||
@Autowired
|
||||
private IPdmBdWorkorderService workorderService;
|
||||
@Autowired
|
||||
private ISysInteractRecordService interactRecordService;
|
||||
@Autowired
|
||||
private WmsToAcsService wmsToAcsService;
|
||||
|
||||
/**
|
||||
* 任务创建
|
||||
@@ -52,7 +67,7 @@ public abstract class AbstractTask {
|
||||
* @author ldjun
|
||||
* @created 2020年6月12日 下午5:52:28
|
||||
*/
|
||||
protected JSONObject renotifyAcs(SchBaseTask task) {
|
||||
protected AcsResponse renotifyAcs(SchBaseTask task) {
|
||||
Assert.notNull(task);
|
||||
List<SchBaseTask> taskList = new ArrayList<>();
|
||||
taskList.add(task);
|
||||
@@ -65,26 +80,65 @@ public abstract class AbstractTask {
|
||||
* @author ldjun
|
||||
* @created 2020年6月12日 下午5:52:28
|
||||
*/
|
||||
protected JSONObject renotifyAcs(List<SchBaseTask> taskList) {
|
||||
protected AcsResponse renotifyAcs(List<SchBaseTask> taskList) {
|
||||
AcsResponse resultForAcs = AcsResponse.requestOk();
|
||||
//1、获取任务
|
||||
//2、根据任务配置补全任务
|
||||
//3、下发
|
||||
List<AcsTaskDto> list = new ArrayList<>();
|
||||
List<AcsTaskDto> list = new CopyOnWriteArrayList<>();
|
||||
for (SchBaseTask task : taskList) {
|
||||
AcsTaskDto taskDto = new AcsTaskDto();
|
||||
taskDto.setExt_task_uuid(task.getTask_code());
|
||||
String responseParam = task.getResponse_param();
|
||||
if (ObjectUtil.isNotEmpty(responseParam)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(responseParam);
|
||||
taskDto.setDirection(jsonObject.getString("direction"));
|
||||
}
|
||||
taskDto.setExt_task_uuid(task.getTask_id());
|
||||
taskDto.setTask_code(task.getTask_code());
|
||||
|
||||
taskDto.setRoute_plan_code("normal");
|
||||
taskDto.setStart_device_code(task.getPoint_code1());
|
||||
taskDto.setNext_device_code(task.getPoint_code2());
|
||||
taskDto.setStart_device_code2(task.getPoint_code3());
|
||||
taskDto.setNext_device_code2(task.getPoint_code4());
|
||||
taskDto.setVehicle_code(task.getVehicle_code());
|
||||
|
||||
taskDto.setVehicle_code2(task.getVehicle_code2());
|
||||
this.setTask(task.getConfig_code(), taskDto);
|
||||
list.add(taskDto);
|
||||
}
|
||||
|
||||
return AcsUtil.notifyAcs("api/wms/task", list);
|
||||
try {
|
||||
// 创建下发对象
|
||||
resultForAcs = wmsToAcsService.renotifyAcs(list);
|
||||
} catch (Exception e) {
|
||||
log.error("任务下发异常: {}", e.getMessage());
|
||||
resultForAcs.setResponseDate(DateUtil.now());
|
||||
resultForAcs.setCode(HttpStatus.HTTP_BAD_REQUEST);
|
||||
resultForAcs.setMessage(e.getMessage());
|
||||
}
|
||||
// 如果下发完毕,就修改状态
|
||||
if (resultForAcs.getCode() == 200) {
|
||||
// 解析
|
||||
JSONArray errArr = resultForAcs.getErrArr();
|
||||
for (SchBaseTask schBaseTask : taskList) {
|
||||
if (errArr == null) {
|
||||
schBaseTask.setTask_status(TaskStatus.ISSUED.getCode());
|
||||
} else {
|
||||
schBaseTask.setTask_status(TaskStatus.ISSUED.getCode());
|
||||
// 判断是否是出错的任务
|
||||
for (int i = 0; i < errArr.size(); i++) {
|
||||
JSONObject errObj = errArr.getJSONObject(i);
|
||||
String taskCode = errObj.getString("task_code");
|
||||
if (taskCode.equals(schBaseTask.getTask_code())) {
|
||||
// 出错的任务就设置出错信息为备注,不是出错就设置下发
|
||||
schBaseTask.setTask_status(TaskStatus.CREATED.getCode());
|
||||
schBaseTask.setRemark(errObj.getString("message"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
taskService.updateBatchById(taskList);
|
||||
}
|
||||
return resultForAcs;
|
||||
}
|
||||
|
||||
private AcsTaskDto setTask(String config_code, AcsTaskDto taskDto) {
|
||||
@@ -103,6 +157,20 @@ public abstract class AbstractTask {
|
||||
public void schedule() {
|
||||
this.autoCreate();
|
||||
this.create();
|
||||
// 下发
|
||||
this.getAllFinishTask();
|
||||
}
|
||||
|
||||
public void getAllFinishTask() {
|
||||
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getTask_status, TaskStatus.CREATED.getCode()));
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
// 下发
|
||||
this.renotifyAcs(list);
|
||||
}
|
||||
|
||||
public void updateTaskStatus(String task_code, TaskStatus status) {
|
||||
this.updateStatus(task_code, status);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +181,7 @@ public abstract class AbstractTask {
|
||||
|
||||
}
|
||||
|
||||
// 以下改为public会出现自动注入类出现问题
|
||||
protected abstract void updateStatus(String task_code, TaskStatus status);
|
||||
|
||||
|
||||
@@ -133,6 +202,15 @@ public abstract class AbstractTask {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 首先组盘在下发任务
|
||||
*
|
||||
* @param param 具体参数
|
||||
*/
|
||||
public String setGroupPlate(JSONObject param) {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param task_code 任务标识
|
||||
* @return
|
||||
@@ -149,7 +227,6 @@ public abstract class AbstractTask {
|
||||
*/
|
||||
public abstract void cancel(String task_code);
|
||||
|
||||
|
||||
/**
|
||||
* 申请任务
|
||||
*
|
||||
@@ -159,35 +236,42 @@ public abstract class AbstractTask {
|
||||
public void apply(JSONObject param) throws BadRequestException {
|
||||
// 申请任务
|
||||
SchBaseTask task = new SchBaseTask(); // 任务实体
|
||||
String apply_point_code = param.getString("device_code");
|
||||
String config_code = param.getString("config_code"); // "HNMLTask"
|
||||
String apply_point_code = param.getString("device_code"); // 请求点
|
||||
String config_code = param.getString("config_code");
|
||||
String requestNo = param.getString("requestNo");
|
||||
String vehicleType = TaskUtils.toAcsVehicleTypeShift(param.getString("vehicle_type"));
|
||||
String vehicleCode = TaskUtils.defaultVehicleCode(param.getString("vehicle_code"));
|
||||
// 1、校验数据
|
||||
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
|
||||
.eq(SchBaseTaskconfig::getConfig_code, config_code));
|
||||
Assert.notNull(taskConfig, "找不到配置文件,请确认[" + config_code + "]配置是否存在!");
|
||||
// 最大任务数
|
||||
Integer tcmn = taskConfig.getTask_create_max_num();
|
||||
List<SchBaseTask> unFinishTasksByTaskConfig = taskService
|
||||
.findUnFinishTasksByTaskConfig(taskConfig.getConfig_code(), apply_point_code, taskConfig.getTask_direction());
|
||||
// 获取执行中的任务
|
||||
List<SchBaseTask> unFinishTasksByTaskConfig = taskService.findUnFinishTasksByTaskConfig(
|
||||
taskConfig.getConfig_code(), apply_point_code, taskConfig.getTask_direction());
|
||||
|
||||
Assert.isFalse(unFinishTasksByTaskConfig.size() >= tcmn, "该点位申请的任务未完成数已超过上限,无法申请任务");
|
||||
Assert.isFalse(unFinishTasksByTaskConfig.size() >= tcmn,
|
||||
apply_point_code + "该点位申请的任务未完成数已超过上限,无法申请任务");
|
||||
// 获取对接位点位对象
|
||||
SchBasePoint pointObj = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, apply_point_code));
|
||||
SchBasePoint pointObj = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getPoint_code, apply_point_code));
|
||||
// 判断是否校验工单
|
||||
if (taskConfig.getIs_check_workorder()) {
|
||||
// 校验工单
|
||||
// 根据对接位的父点位编码(设备)找到工单设备
|
||||
SchBasePoint one = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
SchBasePoint parentPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getPoint_code, pointObj.getParent_point_code()));
|
||||
// 查找当前设备、生产中、
|
||||
// 查找当前设备、生产中
|
||||
PdmBdWorkorder workorder = workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>()
|
||||
.eq(PdmBdWorkorder::getPoint_code, one.getPoint_code())
|
||||
.eq(PdmBdWorkorder::getWorkorder_status, "3"));
|
||||
.eq(PdmBdWorkorder::getPoint_code, parentPoint.getPoint_code())
|
||||
.eq(PdmBdWorkorder::getWorkorder_status, WorkOrderStatusEnum.PRODUCING.getCode()));
|
||||
if (ObjectUtil.isEmpty(workorder)) {
|
||||
throw new BadRequestException("当前设备工单未生产!");
|
||||
throw new BadRequestException("设备" + parentPoint.getPoint_code() + "工单未生产!");
|
||||
}
|
||||
param.put("workorder_code", workorder.getWorkorder_code()); // 静置时间
|
||||
param.put("workorder_code", workorder.getWorkorder_code()); // 工单编码
|
||||
// 设置任务数据
|
||||
task.setVehicle_type(workorder.getVehicle_type());
|
||||
vehicleType = workorder.getVehicle_type();
|
||||
}
|
||||
// 校验是否需要自动agv
|
||||
if (!pointObj.getIs_auto()) {
|
||||
@@ -195,16 +279,23 @@ public abstract class AbstractTask {
|
||||
return;
|
||||
}
|
||||
// 2、创建申请任务
|
||||
task.setAcs_trace_id(param.getString("acs_trace_id"));
|
||||
task.setAcs_trace_id(requestNo);
|
||||
task.setTask_id(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
task.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
task.setConfig_code(config_code);
|
||||
task.setCreate_mode(param.getString("create_mode"));
|
||||
task.setVehicle_code(param.getString("vehicle_code"));
|
||||
task.setCreate_mode(GeneralDefinition.ACS_CREATION);
|
||||
task.setVehicle_code(vehicleCode);
|
||||
task.setVehicle_qty(param.getInteger("vehicle_qty"));
|
||||
task.setVehicle_type(vehicleType);
|
||||
task.setTask_status(TaskStatus.APPLY.getCode());
|
||||
task.setWorkshop_code(taskConfig.getWorkshop_code()); // 车间编码
|
||||
// 设置起/终点
|
||||
this.setTaskPoint(taskConfig, task, apply_point_code);
|
||||
task.setExt_group_data(JSONObject.toJSONString(param));
|
||||
taskService.create(task);
|
||||
|
||||
// 设置组盘 - 需要的话由子类自行实现
|
||||
task.setGroup_id(this.setGroupPlate(param));
|
||||
task.setRequest_param(JSONObject.toJSONString(param));
|
||||
TaskUtils.setCreateByAcs(task); // 设置创建人信息
|
||||
taskService.save(task); // 创建一条单点任务。
|
||||
// 3、判断是否直接找点下发
|
||||
if (taskConfig.getIs_immediate_create()) {
|
||||
this.create();
|
||||
|
||||
@@ -2,29 +2,122 @@ package org.nl.wms.sch.task_manage;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class AcsTaskDto {
|
||||
//任务标识
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String ext_task_uuid;
|
||||
//任务编码
|
||||
private String task_code;
|
||||
//任务类型
|
||||
private String task_type;
|
||||
//起点
|
||||
private String start_device_code;
|
||||
//下一点
|
||||
private String next_device_code;
|
||||
//载具号
|
||||
private String vehicle_code;
|
||||
//载具类型
|
||||
private String vehicle_type;
|
||||
//优先级
|
||||
private String priority;
|
||||
//备注
|
||||
private String remark;
|
||||
//扩展参数
|
||||
private String params;
|
||||
//路由类型
|
||||
private String route_plan_code;
|
||||
|
||||
/**
|
||||
* 任务编号
|
||||
*/
|
||||
private String task_code;
|
||||
|
||||
|
||||
/**
|
||||
* 取货点1
|
||||
*/
|
||||
String start_device_code;
|
||||
|
||||
/**
|
||||
* 放货点1
|
||||
*/
|
||||
String next_device_code;
|
||||
|
||||
/**
|
||||
* 取货点2
|
||||
*/
|
||||
String start_device_code2;
|
||||
|
||||
/**
|
||||
* 放货点2
|
||||
*/
|
||||
String next_device_code2;
|
||||
|
||||
/**
|
||||
* 对接位
|
||||
*/
|
||||
String put_device_code;
|
||||
|
||||
/**
|
||||
* 优先级
|
||||
*/
|
||||
String priority;
|
||||
|
||||
/**
|
||||
* 载具号
|
||||
*/
|
||||
String vehicle_code;
|
||||
|
||||
/**
|
||||
* 载具号2
|
||||
*/
|
||||
String vehicle_code2;
|
||||
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
String vehicle_type;
|
||||
|
||||
/**
|
||||
* 路由方案
|
||||
*/
|
||||
String route_plan_code;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
String task_type;
|
||||
|
||||
/**
|
||||
* 立库任务类型
|
||||
*
|
||||
*/
|
||||
String dtl_type;
|
||||
|
||||
/**
|
||||
* Agv系统类型
|
||||
* 1:1楼叉车系统
|
||||
* 2:2楼1区域AGV系统
|
||||
* 3:2楼2区域AGV系统
|
||||
*/
|
||||
String agv_system_type;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
String remark;
|
||||
|
||||
/**
|
||||
* 烘箱时间
|
||||
*/
|
||||
String oven_time;
|
||||
|
||||
/**
|
||||
* 烘箱温度
|
||||
*/
|
||||
String temperature;
|
||||
|
||||
/**
|
||||
* agv取货高度
|
||||
*/
|
||||
private String start_height;
|
||||
|
||||
/**
|
||||
* agv放货高度
|
||||
*/
|
||||
private String next_height;
|
||||
|
||||
/**
|
||||
* 方向 1往左 2往右
|
||||
*/
|
||||
private String direction;
|
||||
|
||||
/**
|
||||
* 扩展属性
|
||||
*/
|
||||
Map<String,String> params;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user