更新
This commit is contained in:
@@ -494,7 +494,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
|||||||
json.put("unqualified_qty",unqualified_qty);
|
json.put("unqualified_qty",unqualified_qty);
|
||||||
json.put("batch",batch);
|
json.put("batch",batch);
|
||||||
json.put("producetask_code",order_No);
|
json.put("producetask_code",order_No);
|
||||||
json.put("is_full","1");
|
json.put("is_full","0");
|
||||||
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
|
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
|
||||||
if (ObjectUtil.isNotEmpty(result)) {
|
if (ObjectUtil.isNotEmpty(result)) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||||
|
|||||||
@@ -271,7 +271,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
}
|
}
|
||||||
if (!StrUtil.isEmpty(dto.getVehicle_code())) {
|
if (!StrUtil.isEmpty(dto.getVehicle_code())) {
|
||||||
Instruction inst_dto = this.findByContainer(dto.getVehicle_code());
|
Instruction inst_dto = this.findByContainer(dto.getVehicle_code());
|
||||||
if (ObjectUtils.isNotEmpty(inst_dto) && !StrUtil.equals(inst_dto.getTask_id(), dto.getTask_id())) {
|
if (ObjectUtils.isNotEmpty(inst_dto) && !StrUtil.equals(inst_dto.getTask_id(), dto.getTask_id())
|
||||||
|
&& !StrUtil.equals(dto.getVehicle_code(), "999") && !StrUtil.equals(dto.getVehicle_code(), "0000")) {
|
||||||
throw new WDKException("已存在该载具号的指令!");
|
throw new WDKException("已存在该载具号的指令!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
dto = foramte(dto);
|
dto = foramte(dto);
|
||||||
if (!StrUtil.isEmpty(dto.getVehicle_code())) {
|
if (!StrUtil.isEmpty(dto.getVehicle_code())) {
|
||||||
TaskDto vehicle_dto = this.findByContainer(dto.getVehicle_code());
|
TaskDto vehicle_dto = this.findByContainer(dto.getVehicle_code());
|
||||||
if (vehicle_dto != null) {
|
if (vehicle_dto != null && !StrUtil.equals(dto.getVehicle_code(), "999") && !StrUtil.equals(dto.getVehicle_code(), "0000")) {
|
||||||
throw new WDKException("已存在该载具号的任务!");
|
throw new WDKException("已存在该载具号的任务!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,4 +75,11 @@ public interface VehicleService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String,Object> getVehicleByType(Map whereJson, Pageable page);
|
Map<String,Object> getVehicleByType(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取托盘类型
|
||||||
|
* @param vehicle_type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getVehicleType(String vehicle_type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.exception.BadRequestException;
|
import org.nl.exception.BadRequestException;
|
||||||
import org.nl.wms.database.service.MaterialService;
|
import org.nl.wms.database.service.MaterialService;
|
||||||
|
import org.nl.wms.database.service.VehicleService;
|
||||||
import org.nl.wms.database.service.dto.MaterialDto;
|
import org.nl.wms.database.service.dto.MaterialDto;
|
||||||
import org.nl.wms.ext.acs.rest.WmsToJnController;
|
import org.nl.wms.ext.acs.rest.WmsToJnController;
|
||||||
import org.nl.wms.ext.acs.service.impl.WmsToJnServiceImpl;
|
import org.nl.wms.ext.acs.service.impl.WmsToJnServiceImpl;
|
||||||
@@ -39,6 +40,8 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class MaterialServiceImpl implements MaterialService {
|
public class MaterialServiceImpl implements MaterialService {
|
||||||
|
|
||||||
|
private final VehicleService vehicleService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("md_me_material");
|
WQLObject wo = WQLObject.getWQLObject("md_me_material");
|
||||||
@@ -55,18 +58,7 @@ public class MaterialServiceImpl implements MaterialService {
|
|||||||
for (int i = 0; i < content.size(); i++) {
|
for (int i = 0; i < content.size(); i++) {
|
||||||
JSONObject jo = (JSONObject) content.get(i);
|
JSONObject jo = (JSONObject) content.get(i);
|
||||||
Integer stewing_time = jo.getInteger("stewing_time");
|
Integer stewing_time = jo.getInteger("stewing_time");
|
||||||
String vehicle_type = jo.getString("vehicle_type");
|
String vehicle_type = vehicleService.getVehicleType(jo.getString("vehicle_type"));
|
||||||
if (vehicle_type.equals("03")) {
|
|
||||||
vehicle_type = "1";
|
|
||||||
} else if (vehicle_type.equals("04")) {
|
|
||||||
vehicle_type = "2";
|
|
||||||
} else if (vehicle_type.equals("05")) {
|
|
||||||
vehicle_type = "3";
|
|
||||||
} else if (vehicle_type.equals("06")) {
|
|
||||||
vehicle_type = "4";
|
|
||||||
} else if (vehicle_type.equals("07")) {
|
|
||||||
vehicle_type = "5";
|
|
||||||
}
|
|
||||||
jo.put("vehicle_type",vehicle_type);
|
jo.put("vehicle_type",vehicle_type);
|
||||||
if (stewing_time != 0) {
|
if (stewing_time != 0) {
|
||||||
jo.put("stewing_time",stewing_time/60);
|
jo.put("stewing_time",stewing_time/60);
|
||||||
|
|||||||
@@ -257,5 +257,21 @@ public class MdPbVehicleServiceImpl implements VehicleService {
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getVehicleType(String vehicle_type) {
|
||||||
|
if (vehicle_type.equals("03")) {
|
||||||
|
vehicle_type = "1";
|
||||||
|
} else if (vehicle_type.equals("04")) {
|
||||||
|
vehicle_type = "2";
|
||||||
|
} else if (vehicle_type.equals("05")) {
|
||||||
|
vehicle_type = "3";
|
||||||
|
} else if (vehicle_type.equals("06")) {
|
||||||
|
vehicle_type = "4";
|
||||||
|
} else if (vehicle_type.equals("07")) {
|
||||||
|
vehicle_type = "5";
|
||||||
|
}
|
||||||
|
return vehicle_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public interface WmsToJnService {
|
|||||||
Map<String, Object> queryCurrentOrder(Map whereJson);
|
Map<String, Object> queryCurrentOrder(Map whereJson);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 反馈冷却缓冲区
|
* 反馈入冷却缓冲区
|
||||||
*
|
*
|
||||||
* @param
|
* @param
|
||||||
* @return Map<String, Object>
|
* @return Map<String, Object>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import org.nl.wms.common.KilnUtil;
|
|||||||
import org.nl.wms.common.PointUpdateUtil;
|
import org.nl.wms.common.PointUpdateUtil;
|
||||||
import org.nl.wms.common.PressureUtil;
|
import org.nl.wms.common.PressureUtil;
|
||||||
import org.nl.wms.common.StructFindUtil;
|
import org.nl.wms.common.StructFindUtil;
|
||||||
|
import org.nl.wms.database.service.VehicleService;
|
||||||
import org.nl.wms.database.service.dto.VehicleDto;
|
import org.nl.wms.database.service.dto.VehicleDto;
|
||||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||||
import org.nl.wms.sch.manage.AreaEnum;
|
import org.nl.wms.sch.manage.AreaEnum;
|
||||||
@@ -53,6 +54,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
private final TaskService taskService;
|
private final TaskService taskService;
|
||||||
private final ToPackIngTask toPackIngTask;
|
private final ToPackIngTask toPackIngTask;
|
||||||
private final FmjToPackIngTask fmjToPackIngTask;
|
private final FmjToPackIngTask fmjToPackIngTask;
|
||||||
|
private final VehicleService vehicleService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -87,18 +89,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String point_id = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("point_id");
|
String point_id = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("point_id");
|
||||||
String material_id = structivtTable.query("point_id ='" + point_id + "'").uniqueResult(0).getString("material_id");
|
String material_id = structivtTable.query("point_id ='" + point_id + "'").uniqueResult(0).getString("material_id");
|
||||||
JSONObject materiralObj1 = WQLObject.getWQLObject("md_me_material").query("material_id = '" + material_id + "'").uniqueResult(0);
|
JSONObject materiralObj1 = WQLObject.getWQLObject("md_me_material").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||||
String vehicle_type = materiralObj1.getString("vehicle_type");
|
//寻找对应的托盘类型
|
||||||
if (vehicle_type.equals("03")) {
|
String vehicle_type = vehicleService.getVehicleType(materiralObj1.getString("vehicle_type"));
|
||||||
vehicle_type = "1";
|
|
||||||
} else if (vehicle_type.equals("04")) {
|
|
||||||
vehicle_type = "2";
|
|
||||||
} else if (vehicle_type.equals("05")) {
|
|
||||||
vehicle_type = "3";
|
|
||||||
} else if (vehicle_type.equals("06")) {
|
|
||||||
vehicle_type = "4";
|
|
||||||
} else if (vehicle_type.equals("07")) {
|
|
||||||
vehicle_type = "5";
|
|
||||||
}
|
|
||||||
JSONObject jsonObject1 = new JSONObject();
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
jsonObject1.put("device_code", "RGV2");
|
jsonObject1.put("device_code", "RGV2");
|
||||||
@@ -170,35 +162,26 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (StrUtil.equals("1", is_full) && StrUtil.equals(area_type, AreaEnum.FJQY.getCode())) {
|
if (StrUtil.equals("1", is_full) && StrUtil.equals(area_type, AreaEnum.FJQY.getCode())) {
|
||||||
String vehicle_code = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("vehicle_code");
|
String vehicle_code = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("vehicle_code");
|
||||||
jsonObject.put("vehicle_code", vehicle_code);
|
jsonObject.put("vehicle_code", vehicle_code);
|
||||||
if (StrUtil.isEmpty(vehicle_code)) {
|
// if (StrUtil.isEmpty(vehicle_code)) {
|
||||||
throw new BadRequestException("当前点位载具号为空!");
|
// throw new BadRequestException("当前点位载具号为空!");
|
||||||
}
|
// }
|
||||||
toPackIngTask.createTask((JSONObject) JSON.toJSON(jsonObject));
|
toPackIngTask.createTask((JSONObject) JSON.toJSON(jsonObject));
|
||||||
|
|
||||||
//生成到包装位的任务时,下发托盘类型给RGV
|
//生成到包装位的任务时,下发托盘类型给RGV
|
||||||
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'", "create_time desc").uniqueResult(0);
|
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'", "create_time desc").uniqueResult(0);
|
||||||
String vehicle_type = vehicleObj.getString("vehicle_type");
|
if (ObjectUtil.isNotEmpty(vehicleObj)) {
|
||||||
if (vehicle_type.equals("03")) {
|
String vehicle_type = vehicleService.getVehicleType(vehicleObj.getString("vehicle_type"));
|
||||||
vehicle_type = "1";
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
} else if (vehicle_type.equals("04")) {
|
JSONArray array = new JSONArray();
|
||||||
vehicle_type = "2";
|
jsonObject1.put("device_code", "RGV2");
|
||||||
} else if (vehicle_type.equals("05")) {
|
jsonObject1.put("code", "to_container_type");
|
||||||
vehicle_type = "3";
|
jsonObject1.put("value", vehicle_type);
|
||||||
} else if (vehicle_type.equals("06")) {
|
array.add(jsonObject1);
|
||||||
vehicle_type = "4";
|
try {
|
||||||
} else if (vehicle_type.equals("07")) {
|
wmsToAcsServiceImpl.action(array);
|
||||||
vehicle_type = "5";
|
} catch (Exception e) {
|
||||||
}
|
e.printStackTrace();
|
||||||
JSONObject jsonObject1 = new JSONObject();
|
}
|
||||||
JSONArray array = new JSONArray();
|
|
||||||
jsonObject1.put("device_code", "RGV2");
|
|
||||||
jsonObject1.put("code", "to_container_type");
|
|
||||||
jsonObject1.put("value", vehicle_type);
|
|
||||||
array.add(jsonObject1);
|
|
||||||
try {
|
|
||||||
wmsToAcsServiceImpl.action(array);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -348,7 +331,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String vehicle_code = "";
|
String vehicle_code = "";
|
||||||
JSONObject produceInfoByCode = new JSONObject();
|
JSONObject produceInfoByCode = new JSONObject();
|
||||||
String is_full = (String) jsonObject.get("is_full");
|
String is_full = (String) jsonObject.get("is_full");
|
||||||
if (ObjectUtil.isNotEmpty(jsonObject.get("vehicle_code"))) {
|
if (!StrUtil.equals(jsonObject.get("vehicle_code").toString(), "0000")) {
|
||||||
vehicle_code = jsonObject.get("vehicle_code").toString();
|
vehicle_code = jsonObject.get("vehicle_code").toString();
|
||||||
}
|
}
|
||||||
String qty = String.valueOf(jsonObject.get("qty"));
|
String qty = String.valueOf(jsonObject.get("qty"));
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ public class WmsToJnServiceImpl implements WmsToJnService {
|
|||||||
if (StrUtil.isNotEmpty(status) && status.equals("1")) {
|
if (StrUtil.isNotEmpty(status) && status.equals("1")) {
|
||||||
log.info("wms同步嘉耐工单成功!");
|
log.info("wms同步嘉耐工单成功!");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
log.info("wms同步嘉耐工单失败!");
|
log.info("wms同步嘉耐工单失败!");
|
||||||
}
|
}
|
||||||
WQLObject produceTaskTable = WQLObject.getWQLObject("PDM_MG_produceTask");
|
WQLObject produceTaskTable = WQLObject.getWQLObject("PDM_MG_produceTask");
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public interface ProducetaskService {
|
|||||||
*/
|
*/
|
||||||
void issued(JSONObject param);
|
void issued(JSONObject param);
|
||||||
/**
|
/**
|
||||||
* 下发
|
* 同步
|
||||||
* @param param
|
* @param param
|
||||||
*/
|
*/
|
||||||
void synchro(JSONObject param);
|
void synchro(JSONObject param);
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class AutoOutStructTask {
|
|||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("flag", "9");
|
param.put("flag", "9");
|
||||||
param.put("area_type", "01");
|
param.put("area_type", "01");
|
||||||
param.put("if_full", "1");
|
// param.put("if_full", "1");
|
||||||
param.put("material_type", line.getString("material_type"));
|
param.put("material_type", line.getString("material_type"));
|
||||||
String lineMaterialCode = line.getString("material_code");
|
String lineMaterialCode = line.getString("material_code");
|
||||||
if (StrUtil.isNotEmpty(lineMaterialCode) && !StrUtil.equals(lineMaterialCode, "0")) {
|
if (StrUtil.isNotEmpty(lineMaterialCode) && !StrUtil.equals(lineMaterialCode, "0")) {
|
||||||
@@ -85,7 +85,8 @@ public class AutoOutStructTask {
|
|||||||
taskObj.put("vehicle_code", structObj.get("vehicle_code"));
|
taskObj.put("vehicle_code", structObj.get("vehicle_code"));
|
||||||
taskObj.put("material_id", structObj.get("material_id"));
|
taskObj.put("material_id", structObj.get("material_id"));
|
||||||
taskObj.put("create_mode", "02");
|
taskObj.put("create_mode", "02");
|
||||||
taskObj.put("is_full", "1");
|
// taskObj.put("is_full", "1");
|
||||||
|
taskObj.put("is_full", structObj.get("is_full"));
|
||||||
taskObj.put("workprocedure_id", WorkProcedureEnum.SZGX.getId());
|
taskObj.put("workprocedure_id", WorkProcedureEnum.SZGX.getId());
|
||||||
callMaterialTask.createTask(taskObj);
|
callMaterialTask.createTask(taskObj);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user