调通LMS和ACS,按业务需求修改表,去除前端debugger,手持点位绑定确认
This commit is contained in:
@@ -39,7 +39,6 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
|
||||
private final InstructionService InstructionService;
|
||||
private final TaskService TaskService;
|
||||
private final DeviceService DeviceService;
|
||||
private final DeviceAppService DeviceAppService;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class StoreIvtServiceImpl {
|
||||
throw new BadRequestException("仓位标识不能为空!");
|
||||
}
|
||||
String change_qty = disObj.getString("change_qty");
|
||||
if (StrUtil.isEmpty(change_qty)) {
|
||||
change_qty = "0";
|
||||
}
|
||||
if (StrUtil.equals("0", change_qty)) {
|
||||
throw new BadRequestException("变动量不能都为0!");
|
||||
}
|
||||
// if (StrUtil.isEmpty(change_qty)) {
|
||||
// change_qty = "0";
|
||||
// }
|
||||
// if (StrUtil.equals("0", change_qty)) {
|
||||
// throw new BadRequestException("变动量不能都为0!");
|
||||
// }
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("change_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
param.put("struct_id", struct_id);
|
||||
|
||||
Binary file not shown.
@@ -53,8 +53,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONArray errArr = new JSONArray();
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject row = array.getJSONObject(i);
|
||||
String task_uuid = row.getString("task_id");
|
||||
TaskDto taskDto = taskService.findById(task_uuid);
|
||||
String task_code = row.getString("task_code");
|
||||
TaskDto taskDto = taskService.findByCode(task_code);
|
||||
String processing_class = taskDto.getHandle_class();
|
||||
//1:执行中,2:完成 ,3:acs取消
|
||||
String acs_task_status = row.getString("task_status");
|
||||
@@ -87,7 +87,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
log.info("任务状态更新失败:{}", message);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_uuid", task_uuid);
|
||||
json.put("task_uuid", task_code);
|
||||
json.put("message", message);
|
||||
errArr.add(json);
|
||||
|
||||
@@ -97,7 +97,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
log.info("任务状态更新失败:{}", message);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_uuid", task_uuid);
|
||||
json.put("task_uuid", task_code);
|
||||
json.put("message", message);
|
||||
errArr.add(json);
|
||||
|
||||
|
||||
@@ -23,10 +23,17 @@ public class EmptyAndQtyController {
|
||||
|
||||
private final EmptyAndQtyService emptyAndQtyService;
|
||||
|
||||
/**
|
||||
* 点位绑定确认
|
||||
* @param whereJSON String point_id 点位id
|
||||
* String point_status 点位状态
|
||||
* String quality_scode 质量 (ONLY point_status = '03')
|
||||
* @return 提示
|
||||
*/
|
||||
@PostMapping("/confirm")
|
||||
@Log("绑定")
|
||||
@ApiOperation("绑定")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(emptyAndQtyService.confirm(whereJson), HttpStatus.OK);
|
||||
@Log("点位绑定确认")
|
||||
@ApiOperation("点位绑定确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJSON) {
|
||||
return new ResponseEntity<>(emptyAndQtyService.confirm(whereJSON), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ import com.alibaba.fastjson.JSONObject;
|
||||
public interface EmptyAndQtyService {
|
||||
|
||||
/**
|
||||
* 绑定
|
||||
* @param whereJson /
|
||||
* @return JSONObject
|
||||
* 点位绑定确认
|
||||
* @param whereJSON String point_id 点位id
|
||||
* String point_status 点位状态
|
||||
* String quality_scode 质量 (ONLY point_status = '03')
|
||||
* @return 提示
|
||||
*/
|
||||
JSONObject confirm(JSONObject whereJson);
|
||||
JSONObject confirm(JSONObject whereJSON);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.pda.emptyandqty.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -23,29 +24,57 @@ public class EmptyAndQtyServiceImpl implements EmptyAndQtyService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject confirm(JSONObject whereJson) {
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String qty = whereJson.getString("qty");
|
||||
public JSONObject confirm(JSONObject whereJSON) {
|
||||
// 返回值
|
||||
JSONObject resultJSON = new JSONObject();
|
||||
|
||||
WQLObject vqTab = WQLObject.getWQLObject("PDM_BI_vehicleQty");
|
||||
StoragevehicleinfoDto byCode = SpringContextHolder.getBean(StoragevehicleinfoService.class).findByCode(vehicle_code);
|
||||
// 参数校验
|
||||
String pointId = whereJSON.getString("point_id");
|
||||
if (StrUtil.isEmpty(pointId)) {
|
||||
resultJSON.put("code", "0");
|
||||
resultJSON.put("desc", "点位不能为空");
|
||||
return resultJSON;
|
||||
}
|
||||
String pointStatus = whereJSON.getString("point_status");
|
||||
if (StrUtil.isEmpty(pointStatus)) {
|
||||
resultJSON.put("code", "0");
|
||||
resultJSON.put("desc", "点位状态不能为空");
|
||||
return resultJSON;
|
||||
}
|
||||
String qualityScode = whereJSON.getString("quality_scode");
|
||||
if (StrUtil.equals(pointStatus, "03") && StrUtil.isEmpty(qualityScode)) {
|
||||
resultJSON.put("code", "0");
|
||||
resultJSON.put("desc", "质量不能为空");
|
||||
return resultJSON;
|
||||
}
|
||||
|
||||
// 插入记录
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("vehicleqty_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("vehicle_id", byCode.getStoragevehicle_id());
|
||||
json.put("vehicle_code", vehicle_code);
|
||||
json.put("qty", qty);
|
||||
json.put("is_task", "0");
|
||||
json.put("create_id", SecurityUtils.getCurrentUserId());
|
||||
json.put("create_name", SecurityUtils.getNickName());
|
||||
json.put("create_time", DateUtil.now());
|
||||
vqTab.insert(json);
|
||||
// 返回成功
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("srb", "");
|
||||
result.put("code", "1");
|
||||
result.put("desc", "操作成功");
|
||||
return result;
|
||||
// 查询点位
|
||||
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONObject point = pointTable
|
||||
.query("point_id = " + pointId)
|
||||
.uniqueResult(0);
|
||||
if (!StrUtil.equals(point.getString("lock_type"), "00")) {
|
||||
resultJSON.put("code", "0");
|
||||
resultJSON.put("desc", "当前点位已被锁定,请等待AGV任务完成");
|
||||
return resultJSON;
|
||||
}
|
||||
|
||||
// 修改点位
|
||||
point.put("point_status", pointStatus);
|
||||
pointTable.update(point);
|
||||
|
||||
if (StrUtil.equals(pointStatus, "03")) {
|
||||
// 如果是有料桶,则需要修改库存表
|
||||
JSONObject struct = new JSONObject();
|
||||
struct.put("quality_scode", qualityScode);
|
||||
WQLObject
|
||||
.getWQLObject("st_ivt_structivt")
|
||||
.update(struct, "struct_id = " + pointId);
|
||||
}
|
||||
|
||||
// 返回
|
||||
resultJSON.put("code", "1");
|
||||
resultJSON.put("desc", "绑定成功");
|
||||
return resultJSON;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,4 +125,9 @@ public class PointDto implements Serializable {
|
||||
* 设备点位类型
|
||||
*/
|
||||
private String device_point_type;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class TaskServiceImpl implements TaskService {
|
||||
if (StrUtil.isNotEmpty(whereJson.getString("end_time"))) {
|
||||
map.put("end_time", whereJson.getString("end_time"));
|
||||
}
|
||||
JSONObject json = WQL.getWO("QSCH_TASK_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "task.update_time desc");
|
||||
JSONObject json = WQL.getWO("QSCH_TASK_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "task.create_time desc");
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ public class TaskServiceImpl implements TaskService {
|
||||
public void operation(Map<String, Object> map) {
|
||||
String task_id = MapUtil.getStr(map, "task_id");
|
||||
String method_name = MapUtil.getStr(map, "method_name");
|
||||
TaskDto dto = this.findByDtlId(task_id);
|
||||
TaskDto dto = this.findById(task_id);
|
||||
// 任务处理类
|
||||
String processing_class = dto.getHandle_class();
|
||||
String message = "";
|
||||
@@ -187,6 +187,13 @@ public class TaskServiceImpl implements TaskService {
|
||||
Method m = obj.getClass().getMethod(method_name, String.class);
|
||||
JSONObject result = (JSONObject) m.invoke(obj, task_id);
|
||||
if (ObjectUtil.isEmpty(result)) return;
|
||||
|
||||
// 路由不通的情况
|
||||
if (result.getInteger("status") != 200) {
|
||||
log.error(result.getString("message"));
|
||||
throw new BadRequestException("该起点不能送到该终点!");
|
||||
}
|
||||
|
||||
JSONArray arr = result.getJSONArray("errArr");
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_task");
|
||||
if (ObjectUtil.isNotEmpty(arr)) {
|
||||
@@ -213,7 +220,12 @@ public class TaskServiceImpl implements TaskService {
|
||||
throw new BadRequestException(message);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new BadRequestException("任务操作失败!");
|
||||
message = e.getMessage();
|
||||
if (StrUtil.isEmpty(message)) {
|
||||
throw new BadRequestException("任务操作失败!");
|
||||
} else {
|
||||
throw new BadRequestException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,8 @@
|
||||
point.update_time,
|
||||
point.vehicle_type,
|
||||
point.is_host,
|
||||
point.device_point_type
|
||||
point.device_point_type,
|
||||
point.material_code
|
||||
FROM
|
||||
sch_base_point point
|
||||
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
|
||||
|
||||
@@ -105,7 +105,6 @@
|
||||
point.lock_type = '00'
|
||||
AND point.is_used = '1'
|
||||
AND point.is_delete = '0'
|
||||
AND point.point_status = '00'
|
||||
|
||||
OPTION 输入.search <> ""
|
||||
(point.point_code like 输入.search or
|
||||
|
||||
Binary file not shown.
@@ -2,6 +2,7 @@ package org.nl.wms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -43,13 +44,14 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
/**
|
||||
*改变任务状态
|
||||
**/
|
||||
String task_id = taskObj.getString("task_id");
|
||||
String task_code = taskObj.getString("task_code");
|
||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
||||
JSONObject jsonTask = taskTab.query("task_id='" + task_id + "'").uniqueResult(0);
|
||||
JSONObject jsonTask = taskTab.query("task_code='" + task_code + "'").uniqueResult(0);
|
||||
String task_id = jsonTask.getString("task_id");
|
||||
|
||||
if (StrUtil.equals(status,"0")) {
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 取消删除任务
|
||||
taskTab.delete("task_id = '"+task_id+"'");
|
||||
taskTab.delete("task_id = '" + task_id + "'");
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
@@ -76,32 +78,32 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_regionIO");
|
||||
JSONObject mstObj = mstTab.query("task_id='" + task_id + "' and is_delete='0'").uniqueResult(0);
|
||||
//审核 加库存可和用数量
|
||||
StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
|
||||
// StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
|
||||
mstObj.put("bill_status", "50");
|
||||
mstObj.put("confirm_optid", SecurityUtils.getCurrentUserId());
|
||||
mstObj.put("confirm_optname", SecurityUtils.getNickName());
|
||||
mstObj.put("confirm_time", DateUtil.now());
|
||||
mstTab.update(mstObj);
|
||||
|
||||
String iostorinv_id = mstObj.getString("iostorinv_id");
|
||||
String bill_code = mstObj.getString("bill_code");
|
||||
String bill_type_scode =mstObj.getString("bill_type");
|
||||
String next_point_code = mstObj.getString("end_point_code");
|
||||
String start_point_code = mstObj.getString("start_point_code");
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("material_id", mstObj.getString("material_id"));
|
||||
param.put("bill_code", bill_code);
|
||||
param.put("bill_type_scode", bill_type_scode);
|
||||
param.put("bill_id", iostorinv_id);
|
||||
param.put("qty_unit_id", mstObj.getString("qty_unit_id"));
|
||||
param.put("pcsn", mstObj.getString("pcsn"));
|
||||
param.put("change_qty", mstObj.getString("qty"));
|
||||
param.put("vehicle_code", mstObj.getString("vehicle_code"));
|
||||
param.put("region_id", mstObj.getString("start_region_id"));
|
||||
param.put("is_full", mstObj.getString("is_full"));
|
||||
param.put("stewing_time", mstObj.getString("stewing_time"));
|
||||
param.put("producetask_id", mstObj.getString("producetask_id"));
|
||||
param.put("io_type", mstObj.getString("io_type"));
|
||||
// String iostorinv_id = mstObj.getString("iostorinv_id");
|
||||
// String bill_code = mstObj.getString("bill_code");
|
||||
// String bill_type_scode = mstObj.getString("bill_type");
|
||||
String next_point_code = jsonTask.getString("next_point_code");
|
||||
String start_point_code = jsonTask.getString("start_point_code");
|
||||
// JSONObject param = new JSONObject();
|
||||
// param.put("material_id", mstObj.getString("material_id"));
|
||||
// param.put("bill_code", bill_code);
|
||||
// param.put("bill_type_scode", bill_type_scode);
|
||||
// param.put("bill_id", iostorinv_id);
|
||||
// param.put("qty_unit_id", mstObj.getString("qty_unit_id"));
|
||||
// param.put("pcsn", mstObj.getString("pcsn"));
|
||||
// param.put("change_qty", mstObj.getString("qty"));
|
||||
// param.put("vehicle_code", mstObj.getString("vehicle_code"));
|
||||
// param.put("region_id", mstObj.getString("start_region_id"));
|
||||
// param.put("is_full", mstObj.getString("is_full"));
|
||||
// param.put("stewing_time", mstObj.getString("stewing_time"));
|
||||
// param.put("producetask_id", mstObj.getString("producetask_id"));
|
||||
// param.put("io_type", mstObj.getString("io_type"));
|
||||
|
||||
PointServiceImpl pointService = SpringContextHolder.getBean(PointServiceImpl.class);
|
||||
PointDto nextPointDto = pointService.findByCode(next_point_code);
|
||||
@@ -112,25 +114,40 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
if (ObjectUtil.isNull(startPointDto)) {
|
||||
throw new BadRequestException("未找到可用点位:" + start_point_code);
|
||||
}
|
||||
param.put("struct_id", nextPointDto.getPoint_id());
|
||||
ivtService.addIvtFlow(param, IvtChangeTypeEnum.ADD_IVT_AND_CAN_USE);
|
||||
// 解锁点位
|
||||
String vehicle_code = jsonTask.getString("vehicle_code");
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONObject endpointObj = pointTab.query("point_code='" + jsonTask.getString("next_point_code") + "'").uniqueResult(0);
|
||||
endpointObj.put("lock_type", "00");
|
||||
endpointObj.put("point_status", "02");
|
||||
endpointObj.put("vehicle_code", vehicle_code);
|
||||
endpointObj.put("vehicle_type", jsonTask.getString("vehicle_type"));
|
||||
pointTab.update(endpointObj);
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
/* JSONObject startPointObj = pointTab.query("point_code='" + jsonTask.getString("start_point_code") + "'").uniqueResult(0);
|
||||
// 如果终点区域为待检区,则需要添加库存
|
||||
if (nextPointDto.getRegion_id().equals(1572481855792484352L)) {
|
||||
JSONObject struct = new JSONObject();
|
||||
struct.put("stockrecord_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
struct.put("struct_id", nextPointDto.getPoint_id());
|
||||
struct.put("struct_code", nextPointDto.getPoint_code());
|
||||
struct.put("struct_name", nextPointDto.getPoint_name());
|
||||
struct.put("region_id", startPointDto.getRegion_id());
|
||||
struct.put("quality_scode", "00");// 待检品
|
||||
struct.put("instorage_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("st_ivt_structivt").insert(struct);
|
||||
}
|
||||
|
||||
// param.put("struct_id", nextPointDto.getPoint_id());
|
||||
// ivtService.addIvtFlow(param, IvtChangeTypeEnum.ADD_IVT_AND_CAN_USE);
|
||||
// 解锁点位 将起点的点位状态写给终点
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONObject startPointObj = pointTab.query("point_code='" + start_point_code + "'").uniqueResult(0);
|
||||
JSONObject endPointObj = pointTab.query("point_code='" + next_point_code + "'").uniqueResult(0);
|
||||
|
||||
// 起点写给终点
|
||||
endPointObj.put("lock_type", "00");
|
||||
String pointStatus = startPointObj.getString("point_status");
|
||||
endPointObj.put("point_status", pointStatus);
|
||||
pointTab.update(endPointObj);
|
||||
|
||||
// 起点置空
|
||||
startPointObj.put("lock_type", "00");
|
||||
startPointObj.put("point_status", "00");
|
||||
startPointObj.put("vehicle_code", "");
|
||||
pointTab.update(startPointObj);
|
||||
taskTab.update(jsonTask);*/
|
||||
|
||||
// 更新任务
|
||||
taskTab.update(jsonTask);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -186,44 +203,48 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
//请求参数 载具、起点、终点
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
String vehicle_type = form.getString("vehicle_type");
|
||||
String start_point_code = form.getString("start_point_code");
|
||||
String next_point_code = form.getString("next_point_code");
|
||||
String next_point_code = form.getString("next_point_code");;
|
||||
|
||||
WQLObject taskTable = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
WQLObject iosTable = WQLObject.getWQLObject("ST_IVT_regionIO");
|
||||
|
||||
|
||||
if (StrUtil.isEmpty(start_point_code)) {
|
||||
throw new BadRequestException("起点不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(next_point_code)) {
|
||||
throw new BadRequestException("终点不能为空!");
|
||||
}
|
||||
|
||||
PointService pointService = SpringContextHolder.getBean(PointService.class);
|
||||
// 起点是空位不能搬
|
||||
PointDto startPoint = pointService.findByCode(start_point_code);
|
||||
if (StrUtil.equals(startPoint.getPoint_status(), "00")) {
|
||||
throw new BadRequestException("起点是空位!");
|
||||
}
|
||||
|
||||
// 终点不是不合格品区且不是空位不能搬
|
||||
PointDto nextPoint = pointService.findByCode(next_point_code);
|
||||
if (!nextPoint.getRegion_id().equals(1572481902244401152L) && !StrUtil.equals(nextPoint.getPoint_status(), "00")) {
|
||||
throw new BadRequestException("终点不是空位!");
|
||||
}
|
||||
|
||||
//判断起点有没有未完成的指令
|
||||
JSONObject beforTaskObj = taskTable.
|
||||
query("is_delete='0' and start_point_code='" + start_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(beforTaskObj)) {
|
||||
throw new BadRequestException("存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!");
|
||||
throw new BadRequestException("起点存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!");
|
||||
}
|
||||
|
||||
|
||||
if (StrUtil.isEmpty(next_point_code)) {
|
||||
// 终点为空需要找终点
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("start_point_code",start_point_code);
|
||||
JSONObject endPoint = this.findEndPoint(param);
|
||||
next_point_code = endPoint.getString("next_point_code");
|
||||
}
|
||||
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
//终点点加锁
|
||||
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONObject endPointObj = pointTable.query("point_code='" + next_point_code + "'").uniqueResult(0);
|
||||
endPointObj.put("lock_type", "01");
|
||||
pointTable.update(endPointObj);
|
||||
|
||||
// 创建任务
|
||||
PointService pointService = SpringContextHolder.getBean(PointService.class);
|
||||
|
||||
JSONObject taskObj = new JSONObject();
|
||||
CodeUtil.getNewCode("TASK_CODE");
|
||||
String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
@@ -231,18 +252,14 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
taskObj.put("taskdtl_id", task_id);
|
||||
taskObj.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||
taskObj.put("task_type", "01");
|
||||
taskObj.put("vehicle_type", vehicle_type);
|
||||
taskObj.put("taskdtl_type", "01");
|
||||
taskObj.put("acs_task_type", "1");
|
||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskObj.put("start_point_code", start_point_code);
|
||||
PointDto startPoint = pointService.findByCode(start_point_code);
|
||||
taskObj.put("start_area", startPoint.getRegion_id());
|
||||
taskObj.put("request_param", form.toJSONString());
|
||||
taskObj.put("next_point_code", next_point_code);
|
||||
PointDto nextPoint = pointService.findByCode(next_point_code);
|
||||
taskObj.put("next_area", nextPoint.getRegion_id());
|
||||
taskObj.put("vehicle_code", vehicle_code);
|
||||
taskObj.put("handle_class", THIS_CLASS);
|
||||
taskObj.put("is_auto_issue", "1");
|
||||
taskObj.put("create_name", SecurityUtils.getCurrentUsername());
|
||||
@@ -287,7 +304,7 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
* 2.豪凯线 --> 成品区
|
||||
*/
|
||||
String next_point_code = "";
|
||||
if (StrUtil.equals(jsonStartRegion.getString("region_code"),RegionTypeEnum.GJQY.getCode())) {
|
||||
if (StrUtil.equals(jsonStartRegion.getString("region_code"), RegionTypeEnum.GJQY.getCode())) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("region_code", RegionTypeEnum.YSQA.getCode());
|
||||
@@ -295,7 +312,7 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonEndPoint)) throw new BadRequestException("仓位不足");
|
||||
next_point_code = jsonEndPoint.getString("point_code");
|
||||
} else if (StrUtil.equals(jsonStartRegion.getString("region_code"),RegionTypeEnum.HKQY.getCode())) {
|
||||
} else if (StrUtil.equals(jsonStartRegion.getString("region_code"), RegionTypeEnum.HKQY.getCode())) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("region_code", RegionTypeEnum.CPQYA.getCode());
|
||||
@@ -306,7 +323,7 @@ public class SendMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
JSONObject resuft = new JSONObject();
|
||||
resuft.put("next_point_code",next_point_code);
|
||||
resuft.put("next_point_code", next_point_code);
|
||||
return resuft;
|
||||
}
|
||||
|
||||
|
||||
@@ -208,17 +208,8 @@ public class RegionioInServiceImpl implements RegionioInService {
|
||||
form.put("create_mode", jsonIn.getString("create_mode"));
|
||||
form.put("pcsn", jsonIn.getString("pcsn"));
|
||||
form.put("iostorinv_id", iostorinv_id);
|
||||
form.put("material_code", jsonObject.get("material_code"));
|
||||
|
||||
// 根据起点点位 找到对应设备,根据设备找到对应工单,根据工单获取载具类型
|
||||
String device_code = start_point_code.substring(0, start_point_code.indexOf("_"));
|
||||
|
||||
DeviceService deviceBean = SpringContextHolder.getBean(DeviceService.class);
|
||||
DeviceDto deviceDto = deviceBean.findByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(deviceDto)) throw new BadRequestException("此设备不存在");
|
||||
JSONObject jsonOrder = orderTab.query("device_id = '" + deviceDto.getDevice_id() + "' and order_status = '02' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonOrder)) throw new BadRequestException("此设备未在生产中或不存在");
|
||||
|
||||
form.put("vehicle_type", jsonOrder.getString("vehicle_type"));
|
||||
SendMaterialTask sendMaterialTask = new SendMaterialTask();
|
||||
String task_id = sendMaterialTask.createTask(form);
|
||||
|
||||
|
||||
@@ -309,7 +309,6 @@ function CRUD(options) {
|
||||
return
|
||||
}
|
||||
crud.status.edit = CRUD.STATUS.PROCESSING
|
||||
debugger
|
||||
crud.crudMethod.edit(crud.form).then(() => {
|
||||
crud.status.edit = CRUD.STATUS.NORMAL
|
||||
crud.getDataStatus(crud.getDataId(crud.form)).edit = CRUD.STATUS.NORMAL
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="login" :style="'background-image:url('+ Background +');'">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
|
||||
<h3 class="title">
|
||||
永裕家居LMS系统
|
||||
迦南LMS系统
|
||||
</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||
|
||||
@@ -115,7 +115,6 @@ export default {
|
||||
})
|
||||
},
|
||||
open() {
|
||||
debugger
|
||||
this.query.region_id = this.openParam
|
||||
this.crud.toQuery()
|
||||
},
|
||||
|
||||
@@ -171,32 +171,8 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备点位类型" prop="device_point_type">
|
||||
<el-select
|
||||
v-model="form.device_point_type"
|
||||
size="mini"
|
||||
placeholder="设备点位类型"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.device_point_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否专机" prop="is_host">
|
||||
<el-radio-group v-model="form.is_host">
|
||||
<el-radio
|
||||
v-for="item in dict.IS_HOST"
|
||||
:label="item.value"
|
||||
>{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="点位类型" prop="point_type">
|
||||
<el-radio-group v-model="form.point_type">
|
||||
@@ -246,7 +222,7 @@
|
||||
<el-table-column prop="point_status_name" label="点位状态" />
|
||||
<el-table-column prop="lock_type_name" label="锁定类型" />
|
||||
<el-table-column prop="region_name" label="所属区域" width="110" />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" />
|
||||
<el-table-column prop="material_code" label="物料编码" />
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@@ -259,19 +235,6 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="taskdtl_type" label="锁定任务类型" width="110" :formatter="taskdtl_typeFormat" />
|
||||
<el-table-column prop="task_code" label="锁定任务编码" width="100" />
|
||||
<el-table-column prop="inv_code" label="锁定单据编码" width="130" />
|
||||
<el-table-column prop="inv_type" label="锁定单据类型" width="110" :formatter="invtypeFormat" />
|
||||
<el-table-column prop="vehicle_type" label="托盘类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.storagevehicle_type[scope.row.vehicle_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_qty" label="载具数量" />
|
||||
<el-table-column prop="vehicle_type" label="是否专机">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.IS_HOST[scope.row.is_host] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="update_optname" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
<el-table-column
|
||||
@@ -304,7 +267,7 @@ import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
/*import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'*/
|
||||
|
||||
const defaultForm = { device_point_type: null, point_id: null, is_host: null, point_code: null, point_name: null, area_type: null, point_type: '00', point_status: '00', lock_type: '00', vehicle_code: null, source_id: null, remark: null, is_used: null, is_delete: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null }
|
||||
const defaultForm = { device_point_type: null, point_id: null, is_host: null, point_code: null, point_name: null, area_type: null, point_type: '00', point_status: '00', lock_type: '00', vehicle_code: null, source_id: null, remark: null, is_used: null, is_delete: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, material_code: null }
|
||||
export default {
|
||||
name: 'Point',
|
||||
dicts: ['sch_point_type', 'sch_area_type', 'sch_point_status', 'is_used', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'storagevehicle_type', 'IS_HOST', 'device_point_type'],
|
||||
@@ -352,9 +315,6 @@ export default {
|
||||
],
|
||||
lock_type: [
|
||||
{ required: true, message: '锁定类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_host: [
|
||||
{ required: true, message: '是否专机不能为空', trigger: 'blur' }
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
@@ -20,15 +20,6 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具号">
|
||||
<label slot="label">载 具 号:</label>
|
||||
<el-input
|
||||
v-model="query.vehicle_code"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
placeholder="载具号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始点位">
|
||||
<el-input
|
||||
@@ -165,9 +156,9 @@
|
||||
<el-table-column prop="next_area_name" label="下一区域" width="95" show-overflow-tooltip />
|
||||
<el-table-column prop="next_point_code" label="下一点编码" width="85" />
|
||||
<el-table-column prop="next_point_name" label="下一点名称" width="105" show-overflow-tooltip/>
|
||||
<el-table-column prop="vehicle_code" label="载具编码" />
|
||||
<el-table-column prop="material_code" label="物料编码" />
|
||||
<el-table-column prop="remark" label="备注" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="update_by" label="修改者" v-if="false"/>
|
||||
<el-table-column v-if="false" prop="update_by" label="修改者" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="135" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
<el-table-column
|
||||
|
||||
@@ -30,24 +30,6 @@
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编号">
|
||||
<el-input
|
||||
v-model="query.vehicle_code"
|
||||
clearable
|
||||
placeholder="载具编码"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
placeholder="批次"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.bill_status"
|
||||
@@ -128,26 +110,6 @@
|
||||
<el-input v-model="form.material_name" style="width: 200px;" :disabled="crud.status.view > 0" @focus="getMater" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="批次">
|
||||
<label slot="label">批 次:</label>
|
||||
<el-input v-model="form.pcsn" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="载具编码:">
|
||||
<el-input v-model="form.vehicle_code" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数量" prop="qty">
|
||||
<label slot="label">数 量:</label>
|
||||
<el-input v-model="form.qty" style="width: 200px;" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -218,7 +180,7 @@
|
||||
<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 v-if="false" prop="iostorinv_id" label="出入单标识" />
|
||||
<el-table-column prop="bill_code" label="单据编号" show-overflow-tooltip width="120px">
|
||||
<el-table-column prop="bill_code" label="单据编号" width="130px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||
</template>
|
||||
@@ -228,14 +190,10 @@
|
||||
{{ dict.label.st_bill_status[scope.row.bill_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" show-overflow-tooltip width="120px" />
|
||||
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="120px" />
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" />
|
||||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum2" />
|
||||
<el-table-column prop="unit_name" label="单位" />
|
||||
<el-table-column prop="start_point_name" label="起始点位" show-overflow-tooltip width="120px" />
|
||||
<el-table-column prop="end_point_name" label="终点点位" show-overflow-tooltip width="120px" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="130px" />
|
||||
<el-table-column prop="material_name" label="物料名称" width="130px" />
|
||||
<el-table-column prop="start_point_name" label="起始点位" width="130px" />
|
||||
<el-table-column prop="end_point_name" label="终点点位" width="130px" />
|
||||
<el-table-column prop="start_region_name" label="起始区域" />
|
||||
<el-table-column prop="end_region_name" label="终点区域" />
|
||||
<el-table-column prop="task_id" label="任务标识" show-overflow-tooltip width="120px"/>
|
||||
@@ -348,9 +306,6 @@ export default {
|
||||
material_id: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'blur' }
|
||||
],
|
||||
qty: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
start_region_id: [
|
||||
{ required: true, message: '起点区域不能为空', trigger: 'blur' }
|
||||
],
|
||||
@@ -380,7 +335,6 @@ export default {
|
||||
this.materDialog = true
|
||||
},
|
||||
setMaterValue(row) {
|
||||
debugger
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_name = row.material_name
|
||||
},
|
||||
|
||||
@@ -175,7 +175,6 @@ export default {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatQty(row) {
|
||||
debugger
|
||||
if (row.vehicle_qty === '') {
|
||||
return '0'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user