Merge branch 'master' of http://121.40.234.130:8899/root/rongLiJiaNai
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
public enum ActionType {
|
||||
CALL_MATERIAL, CALL_EMPTY, SEND_MATERIAL, SEND_EMPTY;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
public class AppMain {
|
||||
public static void main(String[] args) {
|
||||
Device ylj= Device.builder().build();
|
||||
ylj.callMaterial();
|
||||
|
||||
/* ylj.sendMaterial(m,sld);
|
||||
ylj.sendEmpty("123",sld);
|
||||
ylj.callEmpty(sld);*/
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
|
||||
/**
|
||||
* 所有的状态和类型都是以01开始
|
||||
* 呼叫物料业务
|
||||
*/
|
||||
public class CallMaterialTask {
|
||||
public void create(Device device) {
|
||||
//1、判断是否有库存
|
||||
//2、如果有库存则生成出库单,并生成AGV搬运任务,否则判断是否需要通过定时器一直判断库存(半条任务)
|
||||
|
||||
//任务表【SCH_BASE_Task】
|
||||
Task task = Task.builder().acs_task_type("1")
|
||||
.create_id("2")
|
||||
.create_time("3")
|
||||
.build();
|
||||
|
||||
String jsonString = JSON.toJSONString(task);
|
||||
JSONObject jSONObject = JSONObject.parseObject(jsonString);
|
||||
//任务表【SCH_BASE_Task】
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(jSONObject);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
//任务表【SCH_BASE_Task】
|
||||
Task task = Task.builder().acs_task_type("3")
|
||||
.create_id("1")
|
||||
.create_time("4")
|
||||
.build();
|
||||
|
||||
String jsonString = JSONObject.toJSONString(task);
|
||||
JSONObject jSONObject = JSONObject.parseObject(jsonString);
|
||||
System.out.println(jSONObject);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
/**
|
||||
* 呼叫空载具业务
|
||||
*/
|
||||
public class CallVehicleTask {
|
||||
public void create(LinkLine line) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 需求和开发组-
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
public class Device {
|
||||
private WorkProcedure workProcedure;
|
||||
//前一工序
|
||||
private WorkProcedure preWorkProcedure;
|
||||
//后一工序
|
||||
private WorkProcedure nextWorkProcedure;
|
||||
|
||||
/**
|
||||
* 设备存在的点位信息:如上料点,下料点,送空载具点,上空载具点等等
|
||||
*/
|
||||
private List<Point> points;
|
||||
|
||||
/**
|
||||
* 前一个区域查找物料位置
|
||||
*/
|
||||
private List<Sect> preMaterialSects;
|
||||
/**
|
||||
* 下一个区域查找物料位置
|
||||
*/
|
||||
private List<Sect> nextMaterialSects;
|
||||
|
||||
/**
|
||||
* 前一个区域查找载具位置
|
||||
*/
|
||||
private List<Sect> preVehicleSects;
|
||||
|
||||
/**
|
||||
* 下一个区域查找空位置存储载具
|
||||
*/
|
||||
private List<Sect> nextVehicleSects;
|
||||
|
||||
/**
|
||||
* 上料点
|
||||
*/
|
||||
private Point upMaterialPoint;
|
||||
/**
|
||||
* 下料点
|
||||
*/
|
||||
private Point downMaterialPoint;
|
||||
|
||||
/**
|
||||
* 上空托盘点
|
||||
*/
|
||||
private Point upVehiclePoint;
|
||||
/**
|
||||
* 送空托盘点
|
||||
*/
|
||||
private Point downVehiclePoint;
|
||||
|
||||
/**
|
||||
* 叫料时,如果库内没有物料,是否采用定时器循环一直呼叫,默认true
|
||||
*/
|
||||
private boolean isAllAlongCallMaterial = true;
|
||||
|
||||
/**
|
||||
* 叫料时,如果库内没有载具,是否采用定时器循环一直呼叫,默认true
|
||||
*/
|
||||
private boolean isAllAlongCallVehicle = true;
|
||||
/**
|
||||
* 生产中的物料
|
||||
*/
|
||||
private Material material;
|
||||
|
||||
|
||||
/**
|
||||
* 叫料时,如果库内没有物料,是否采用定时器循环一直呼叫,默认true
|
||||
*/
|
||||
private boolean isAllAlongSendMaterial = true;
|
||||
|
||||
/**
|
||||
* 叫料时,如果库内没有载具,是否采用定时器循环一直呼叫,默认true
|
||||
*/
|
||||
private boolean isAllAlongSendVehicle = true;
|
||||
|
||||
|
||||
/**
|
||||
* 1、设备叫料,判断库存是否满足
|
||||
*/
|
||||
public void callMaterial() {
|
||||
//1、根据物料信息,查找起点区域位置
|
||||
//1、查找起点
|
||||
//2、创建任务
|
||||
/*LinkLine line = new LinkLine();
|
||||
line.setName("压力机叫料");
|
||||
line.setStartSects(this.preMaterialSects);*/
|
||||
CallMaterialTask task = new CallMaterialTask();
|
||||
task.create(this);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 1、呼叫空托盘
|
||||
*/
|
||||
public void callEmpty() {
|
||||
//1、查找起点
|
||||
//2、
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 1、送空托盘
|
||||
*/
|
||||
public void sendEmpty() {
|
||||
//1、查找起点
|
||||
//2、
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 1、送料
|
||||
*/
|
||||
public void sendMaterial() {
|
||||
//1、查找起点
|
||||
//2、
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class LinkLine {
|
||||
/**
|
||||
* 连线名字
|
||||
*/
|
||||
private String name;
|
||||
private List<Sect> startSects;
|
||||
private List<Sect> nextSects;
|
||||
private Point start;
|
||||
private Point next;
|
||||
private ActionType a;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Material {
|
||||
private String material_id;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OutStore {
|
||||
|
||||
public List<Point> create(Material material){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
public class Point {
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ProductLine {
|
||||
/**
|
||||
* 工序列表
|
||||
*/
|
||||
private List<WorkProcedure> workProcedures;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
public class Sect {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
public class Struct {
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class Task {
|
||||
private Long task_code;
|
||||
private Long task_id;
|
||||
private String task_type;
|
||||
private String acs_task_type; //1普通任务2 其它任务
|
||||
private String start_point_code;
|
||||
private String next_point_code;
|
||||
private String vehicle_code;
|
||||
private String handle_class;
|
||||
private String car_no;
|
||||
private String finished_type;
|
||||
private String remark;
|
||||
private String is_auto_issue;
|
||||
private String is_delete;
|
||||
private String create_id;
|
||||
private String create_name;
|
||||
private String create_time;
|
||||
private String update_optid;
|
||||
private String update_optname;
|
||||
private String update_time;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package org.nl.start.day01;
|
||||
|
||||
|
||||
public class WorkProcedure {
|
||||
private String id;
|
||||
private String code;
|
||||
private String name;
|
||||
|
||||
//前一工序
|
||||
private WorkProcedure preWorkProcedure;
|
||||
//后一工序
|
||||
private WorkProcedure nextWorkProcedure;
|
||||
|
||||
//是否工序前缓存
|
||||
private boolean isPreSect;
|
||||
//工序前缓存
|
||||
private Sect preSect;
|
||||
//工序后缓存
|
||||
private Sect nextSect;
|
||||
|
||||
//是否工序后缓存
|
||||
private boolean isNextSect;
|
||||
|
||||
//属于哪一到工序
|
||||
private ProductLine line;
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package org.nl.wms;
|
||||
//特殊点位
|
||||
public enum SpecialPintoEnum {
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.nl.wms;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 工序类型类型,对应工序表:生产工序表【PDM_BASE_workProcedure】
|
||||
|
||||
@@ -4,11 +4,8 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alipay.api.domain.BFActivityOpenApiInfo;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.start.day01.Struct;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.ResultBean;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
|
||||
public class StructFindUtil {
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -12,6 +13,7 @@ import org.springframework.http.HttpStatus;
|
||||
/**
|
||||
* ACS连接工具类:
|
||||
*/
|
||||
@Slf4j
|
||||
public class AcsUtil {
|
||||
public static JSONObject notifyAcs(String api, JSONArray list) {
|
||||
//判断是否连接ACS系统
|
||||
@@ -27,6 +29,7 @@ public class AcsUtil {
|
||||
String acsUrl = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("ACS_URL").getValue();
|
||||
|
||||
String url = acsUrl + api;
|
||||
log.info("下发acs任务的参数为:{}", list.toString());
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(list))
|
||||
|
||||
@@ -77,7 +77,7 @@ public class AutoCreateTask {
|
||||
});
|
||||
String api = "api/wms/task";
|
||||
|
||||
log.info("下发acs任务的参数为:{}", arr.toString());
|
||||
|
||||
JSONObject result = AcsUtil.notifyAcs(api, arr);
|
||||
log.info("下发acs任务的返回结果为:{}", result.toString());
|
||||
|
||||
@@ -103,8 +103,8 @@ public class AutoCreateTask {
|
||||
JSONObject taskObj = new JSONObject();
|
||||
taskObj.put("task_id", item.getExt_task_uuid());
|
||||
//下发失败,改状态为了重新下发
|
||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
// taskObj.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
// taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskObj.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
taskObj.put("remark", "下发失败:" + message);
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
|
||||
Reference in New Issue
Block a user