fix: 修复路线锁定逻辑,添加校验物料信息逻辑
This commit is contained in:
@@ -39,7 +39,7 @@ public class ConnectorToWmsController {
|
||||
@Log("推送物料信息")
|
||||
@ApiOperation("推送物料信息")
|
||||
@SaIgnore
|
||||
@PostMapping("/createMaterial")
|
||||
@PostMapping("/addMaterial")
|
||||
public ResponseEntity<Object> createMaterial(@RequestBody JSONArray jsonArray){
|
||||
return new ResponseEntity(connectorService.createMaterial(jsonArray), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dreamlu.mica.core.exception.ServiceException;
|
||||
import nl.basjes.shaded.org.springframework.util.Assert;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.config.MapOf;
|
||||
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
@@ -130,6 +132,14 @@ public class ConnectorToWmsServiceImpl implements ConnectorToWmsService {
|
||||
Assert.noNullElements(jsonArray, "请求参数为空!");
|
||||
List<ConnectorDto> connectorDtos = BeanUtil.copyToList(jsonArray, ConnectorDto.class);
|
||||
for (ConnectorDto connectorDto : connectorDtos) {
|
||||
SchBaseVehiclematerialgroup one = iSchBaseVehiclematerialgroupService.getOne(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
|
||||
.eq(SchBaseVehiclematerialgroup::getJob_name, connectorDto.getJobname())
|
||||
.eq(SchBaseVehiclematerialgroup::getMaterial_id, connectorDto.getProductID())
|
||||
.eq(SchBaseVehiclematerialgroup::getOrder_code, connectorDto.getProductionOrder()));
|
||||
if (ObjectUtil.isNotNull(one)) {
|
||||
throw new BadRequestException("jobName:" + connectorDto.getJobname() + "orderCode:"
|
||||
+ connectorDto.getProductionOrder() + "ProductID:" + connectorDto.getProductID() + "该物料信息已存在!");
|
||||
}
|
||||
SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup();
|
||||
schBaseVehiclematerialgroup.setVehicle_code(connectorDto.getVehicle_code());
|
||||
schBaseVehiclematerialgroup.setJob_name(connectorDto.getJobname());
|
||||
|
||||
@@ -208,11 +208,28 @@ public class HandheldServiceImpl implements HandheldService {
|
||||
case "3":
|
||||
goWxOrNx(param, region_code, device_code, vehicle_code, connectorTask);
|
||||
break;
|
||||
case "4":
|
||||
connectorBlanking(schBasePoint, param, region_code, device_code, vehicle_code, connectorTask);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* connector下料入库
|
||||
*
|
||||
* @param schBasePoint
|
||||
* @param param
|
||||
* @param region_code
|
||||
* @param device_code
|
||||
* @param vehicle_code
|
||||
* @param connectorTask
|
||||
*/
|
||||
private void connectorBlanking(SchBasePoint schBasePoint, JSONObject param, String region_code, String device_code, String vehicle_code, AbstractTask connectorTask) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 物料下料去货架
|
||||
*
|
||||
@@ -506,10 +523,10 @@ public class HandheldServiceImpl implements HandheldService {
|
||||
SysParamServiceImpl sysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class);
|
||||
Param isInvokeConnector = sysParamService.findByCode(GeneralDefinition.HANDHELD_LOGIN_TIME);
|
||||
int loginTime = 3;
|
||||
if(ObjectUtil.isNotEmpty(isInvokeConnector)){
|
||||
if (ObjectUtil.isNotEmpty(isInvokeConnector)) {
|
||||
loginTime = Integer.parseInt(isInvokeConnector.getValue());
|
||||
}
|
||||
redisUtils.set("mobile:" + json.getString("device_code"), json.getString("device_code"),loginTime, TimeUnit.HOURS);
|
||||
redisUtils.set("mobile:" + json.getString("device_code"), json.getString("device_code"), loginTime, TimeUnit.HOURS);
|
||||
}
|
||||
}
|
||||
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(json.getString("device_code"));
|
||||
@@ -536,13 +553,13 @@ public class HandheldServiceImpl implements HandheldService {
|
||||
@Override
|
||||
public void updateRoute(JSONObject json) {
|
||||
Assert.noNullElements(new String[]{json.getString("type"), json.getString("status")}, "参数不能为空!");
|
||||
switch(json.getString("type")){
|
||||
switch (json.getString("type")) {
|
||||
case "1":
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
SysParamServiceImpl sysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class);
|
||||
Param isConnectConnector = sysParamService.findByCode(GeneralDefinition.ADD_ROUTE_DOOR_1);
|
||||
jsonObject.put("pointCode",isConnectConnector.getValue());
|
||||
jsonObject.put("status",json.getString("status"));
|
||||
jsonObject.put("pointCode", isConnectConnector.getValue());
|
||||
jsonObject.put("status", json.getString("status"));
|
||||
wmsToAcsService.notifyAcs1(jsonObject);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.google.gson.Gson;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.enums.region.RegionEnum;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.config.MapOf;
|
||||
import org.nl.wms.ext.connector.service.dto.ConnectorDto;
|
||||
@@ -94,14 +95,23 @@ public class SortingServiceImpl implements SortingService {
|
||||
connectorTask.apply(taskParam);
|
||||
//TODO:叫料
|
||||
} else if (SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)) {
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
return MapOf.of("status", 400, "msg", "载具号未传递!");
|
||||
}
|
||||
taskParam.put("config_code", "SortingCMTTask");
|
||||
connectorTask.apply(taskParam);
|
||||
//TODO:将空托盘放到线边库
|
||||
} else if (SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)) {
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
return MapOf.of("status", 400, "msg", "载具号未传递!");
|
||||
}
|
||||
taskParam.put("config_code", "SortingSNTTask");
|
||||
connectorTask.apply(taskParam);
|
||||
//TODO:将满料放到线边库
|
||||
} else if (SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)) {
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
return MapOf.of("status", 400, "msg", "载具号未传递!");
|
||||
}
|
||||
taskParam.put("config_code", "SortingSMTTask");
|
||||
connectorTask.apply(taskParam);
|
||||
}
|
||||
@@ -109,12 +119,12 @@ public class SortingServiceImpl implements SortingService {
|
||||
//TODO:呼叫两个空笼框
|
||||
if (SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)) {
|
||||
taskParam.put("device_code", pointCode + "_01");
|
||||
taskParam.put("task_seq","1");
|
||||
taskParam.put("task_seq", "1");
|
||||
taskParam.put("config_code", "SortingTwoCNTTask");
|
||||
taskParam.put("task_code", task_code + "A");
|
||||
connectorTask.apply(taskParam);
|
||||
taskParam.put("device_code", pointCode + "_02");
|
||||
taskParam.put("task_seq","2");
|
||||
taskParam.put("task_seq", "2");
|
||||
taskParam.put("task_code", task_code + "B");
|
||||
connectorTask.apply(taskParam);
|
||||
//TODO:将两个笼框放到线边库
|
||||
@@ -123,13 +133,13 @@ public class SortingServiceImpl implements SortingService {
|
||||
return MapOf.of("status", 400, "msg", "第二个笼框载具号未传递!");
|
||||
}
|
||||
taskParam.put("config_code", "SortingSMTTask");
|
||||
taskParam.put("task_seq","1");
|
||||
taskParam.put("task_seq", "1");
|
||||
taskParam.put("vehicle_code", jsonObject.getString("vehicle_code2"));
|
||||
taskParam.put("device_code", pointCode + "_02");
|
||||
taskParam.put("task_code", task_code + "B");
|
||||
connectorTask.apply(taskParam);
|
||||
taskParam.put("vehicle_code", vehicle_code);
|
||||
taskParam.put("task_seq","2");
|
||||
taskParam.put("task_seq", "2");
|
||||
taskParam.put("device_code", pointCode + "_01");
|
||||
taskParam.put("task_code", task_code + "A");
|
||||
connectorTask.apply(taskParam);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.sch.task_manage.task.tasks.sorting;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -70,9 +71,13 @@ public class SortingSMTTask extends AbstractTask {
|
||||
String requestParam = task.getRequest_param();
|
||||
JSONObject jsonObject = JSONObject.parseObject(requestParam);
|
||||
JSONArray pallet_detail = jsonObject.getJSONArray("pallet_detail");
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(StrUtil.toString(pallet_detail.get(0)));
|
||||
String regionCode = StrUtil.isEmpty(jsonObject1.getString("NextOperation")) ?
|
||||
RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code() : jsonObject1.getString("NextOperation");
|
||||
String NextOperation = null;
|
||||
if (CollUtil.isNotEmpty(pallet_detail) && pallet_detail.size() > 0) {
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(StrUtil.toString(pallet_detail.get(0)));
|
||||
NextOperation = ObjectUtil.isNotEmpty(jsonObject1) && StrUtil.isNotEmpty(jsonObject1.getString("NextOperation")) ? jsonObject1.getString("NextOperation") : null;
|
||||
}
|
||||
String regionCode = StrUtil.isEmpty(NextOperation) ?
|
||||
RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code() : NextOperation;
|
||||
// 根据对接位查找对应的载具类型
|
||||
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(regionCode, task.getVehicle_code(), "1");
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
|
||||
@@ -167,11 +167,11 @@
|
||||
{{ scope.row.vehicle_code ? scope.row.vehicle_code : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_code2" label="载具编码2" :min-width="flexWidth('vehicle_code2',crud.data,'载具编码2')">
|
||||
<!-- <el-table-column prop="vehicle_code2" label="载具编码2" :min-width="flexWidth('vehicle_code2',crud.data,'载具编码2')">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.vehicle_code2 ? scope.row.vehicle_code2 : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="task_class_id" label="任务分类" :min-width="flexWidth('task_class_id',crud.data,'任务分类')" />-->
|
||||
<el-table-column prop="task_status" label="任务状态" :min-width="flexWidth('task_status',crud.data,'任务状态')">
|
||||
<template slot-scope="scope">
|
||||
@@ -182,8 +182,7 @@
|
||||
<el-table-column prop="config_code" label="配置编码" :min-width="flexWidth('config_code',crud.data,'配置编码')" />
|
||||
<el-table-column prop="point_code1" label="点位1" :min-width="flexWidth('point_code1',crud.data,'点位1')" />
|
||||
<el-table-column prop="point_code2" label="点位2" :min-width="flexWidth('point_code2',crud.data,'点位2')" />
|
||||
<el-table-column prop="point_code3" label="点位3" :min-width="flexWidth('point_code3',crud.data,'点位3')" />
|
||||
<el-table-column prop="point_code4" label="点位4" :min-width="flexWidth('point_code4',crud.data,'点位4')" />
|
||||
<el-table-column prop="request_param" label="请求参数" :min-width="flexWidth('request_param',crud.data,'请求参数')" />
|
||||
<!-- <el-table-column prop="start_wait_point" label="取货等待点" :min-width="flexWidth('start_wait_point',crud.data,'取货等待点')" />-->
|
||||
<el-table-column v-if="false" prop="next_wait_point" label="放货等待点" :min-width="flexWidth('next_wait_point',crud.data,'放货等待点')" />
|
||||
<el-table-column v-if="false" prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)">
|
||||
|
||||
Reference in New Issue
Block a user