fix: 手持功能
This commit is contained in:
@@ -42,5 +42,5 @@ public interface WmsToAcsService {
|
|||||||
* @param list
|
* @param list
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ResultForAcs getDeviceStatusByCode(List<DeviceInfoDto> list);
|
AcsResponse getDeviceStatusByCode(List<DeviceInfoDto> list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,4 +10,10 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class DeviceInfoDto {
|
public class DeviceInfoDto {
|
||||||
private String device_code;
|
private String device_code;
|
||||||
|
|
||||||
|
public static DeviceInfoDto buildDevice(String device_code) {
|
||||||
|
DeviceInfoDto infoDto = new DeviceInfoDto();
|
||||||
|
infoDto.setDevice_code(device_code);
|
||||||
|
return infoDto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
|
|||||||
@Data
|
@Data
|
||||||
public class AcsResponse extends BaseResponse {
|
public class AcsResponse extends BaseResponse {
|
||||||
private JSONArray errArr = new JSONArray();
|
private JSONArray errArr = new JSONArray();
|
||||||
|
private JSONArray data = new JSONArray();
|
||||||
|
|
||||||
public static AcsResponse requestRefuse(String message) {
|
public static AcsResponse requestRefuse(String message) {
|
||||||
AcsResponse result = new AcsResponse();
|
AcsResponse result = new AcsResponse();
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请贴标
|
* 申请贴标 - 打印唛头
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ApplyTaskResponse applyLabelling(JSONObject param) {
|
public ApplyTaskResponse applyLabelling(JSONObject param) {
|
||||||
@@ -595,7 +595,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
mesMudConsumptionDto.setOUT_FINNUM(one.getMaterial_weight());
|
mesMudConsumptionDto.setOUT_FINNUM(one.getMaterial_weight());
|
||||||
mesMudConsumptionDto.setPRESSUNIT(devicePoint.getExt_point_code());
|
mesMudConsumptionDto.setPRESSUNIT(devicePoint.getExt_point_code());
|
||||||
mesMudConsumptionDto.setFBAGCODE(one.getExt_data());
|
mesMudConsumptionDto.setFBAGCODE(one.getExt_data());
|
||||||
mesMudConsumptionDto.setLOGT("仓库未知");
|
mesMudConsumptionDto.setLOGT("配料仓");
|
||||||
mesMudConsumptionDto.setSENDTIM(DateUtil.now());
|
mesMudConsumptionDto.setSENDTIM(DateUtil.now());
|
||||||
mesMudConsumptionDto.setCREATE_TM(DateUtil.now());
|
mesMudConsumptionDto.setCREATE_TM(DateUtil.now());
|
||||||
mesMudConsumptionDto.setOP_FLAG(GeneralDefinition.NO);
|
mesMudConsumptionDto.setOP_FLAG(GeneralDefinition.NO);
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultForAcs getDeviceStatusByCode(List<DeviceInfoDto> list) {
|
public AcsResponse getDeviceStatusByCode(List<DeviceInfoDto> list) {
|
||||||
String api = ""; // todo: 地址未确认
|
String api = "/api/wms/querydevice"; // todo: 地址未确认
|
||||||
ResultForAcs resultForAcs = AcsUtil.notifyAcs(api, list);
|
AcsResponse resultForAcs = AcsUtil.notifyAcs2(api, list);
|
||||||
// 记录日志
|
// 记录日志
|
||||||
interactRecordService.saveRecord("获取设备状态", list, resultForAcs, GeneralDefinition.LMS_ACS);
|
interactRecordService.saveRecord("获取设备信息", list, resultForAcs, GeneralDefinition.LMS_ACS);
|
||||||
return resultForAcs;
|
return resultForAcs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,10 @@ public class WmsToMesServiceImpl implements WmsToMesService {
|
|||||||
// 获取工单
|
// 获取工单
|
||||||
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode);
|
PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode);
|
||||||
String extData = workorder.getExt_data();
|
String extData = workorder.getExt_data();
|
||||||
MesWorkOrderDto mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
|
MesWorkOrderDto mesWorkOrderDto = new MesWorkOrderDto();
|
||||||
|
if (ObjectUtil.isNotEmpty(extData)) {
|
||||||
|
mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class);
|
||||||
|
}
|
||||||
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
|
log.info("获取MES给的工单数据:{}", mesWorkOrderDto);
|
||||||
MesSemiProductionInfoOutDto semiProductionInfoOutDto = new MesSemiProductionInfoOutDto();
|
MesSemiProductionInfoOutDto semiProductionInfoOutDto = new MesSemiProductionInfoOutDto();
|
||||||
semiProductionInfoOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
|
semiProductionInfoOutDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
|
|||||||
@@ -3,12 +3,16 @@ package org.nl.wms.pda.service.impl;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.wms.database.material.service.IMdBaseMaterialService;
|
import org.nl.wms.database.material.service.IMdBaseMaterialService;
|
||||||
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
|
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
|
||||||
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
|
import org.nl.wms.ext.acs.service.dto.to.acs.DeviceInfoDto;
|
||||||
|
import org.nl.wms.ext.acs.service.dto.to.wms.AcsResponse;
|
||||||
import org.nl.wms.pda.service.PdaService;
|
import org.nl.wms.pda.service.PdaService;
|
||||||
import org.nl.wms.pda.service.dao.dto.*;
|
import org.nl.wms.pda.service.dao.dto.*;
|
||||||
import org.nl.wms.pda.service.dao.mapper.PdaMapper;
|
import org.nl.wms.pda.service.dao.mapper.PdaMapper;
|
||||||
@@ -30,6 +34,7 @@ import org.nl.wms.util.TaskUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,6 +59,8 @@ public class PdaServiceImpl implements PdaService {
|
|||||||
private ISchBaseTaskService taskService;
|
private ISchBaseTaskService taskService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPdmBdVehicleBindingService vehicleBindingService;
|
private IPdmBdVehicleBindingService vehicleBindingService;
|
||||||
|
@Autowired
|
||||||
|
private WmsToAcsService wmsToAcsService;
|
||||||
@Override
|
@Override
|
||||||
public List<DropdownListVo> getDeviceInfo() {
|
public List<DropdownListVo> getDeviceInfo() {
|
||||||
// 暂定压机区域
|
// 暂定压机区域
|
||||||
@@ -120,20 +127,18 @@ public class PdaServiceImpl implements PdaService {
|
|||||||
if (ObjectUtil.isEmpty(blendingMoveDto.getStart_point_code())) {
|
if (ObjectUtil.isEmpty(blendingMoveDto.getStart_point_code())) {
|
||||||
throw new BadRequestException("混碾位不能为空");
|
throw new BadRequestException("混碾位不能为空");
|
||||||
}
|
}
|
||||||
// if (ObjectUtil.isEmpty(blendingMoveDto.getEnd_point_code())) {
|
// 向acs获取吨袋号、重量
|
||||||
// throw new BadRequestException("目标压机位不能为空");
|
SchBasePoint basePoint = pointService.getById(blendingMoveDto.getStart_point_code());
|
||||||
// }
|
List<DeviceInfoDto> list = new ArrayList<>();
|
||||||
// 获取压机对应的困料线、空位、无任务
|
list.add(DeviceInfoDto.buildDevice(basePoint.getParent_point_code()));
|
||||||
// SchBasePoint point = pdaMapper.findKLXPoint(blendingMoveDto.getEnd_point_code());
|
AcsResponse statusByCode = wmsToAcsService.getDeviceStatusByCode(list);
|
||||||
// if (ObjectUtil.isEmpty(point)) {
|
JSONArray data = statusByCode.getData();
|
||||||
// throw new BadRequestException("创建失败,已有搬运到【" + blendingMoveDto.getEnd_point_code() + "】的任务, 请稍后在试!");
|
JSONObject object = data.getJSONObject(0);
|
||||||
// }
|
|
||||||
// todo: 1、向acs获取吨袋号、重量
|
|
||||||
// 准备参数:设备编码、载具号、载具类型、重量、吨袋号(material_code)
|
// 准备参数:设备编码、载具号、载具类型、重量、吨袋号(material_code)
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", blendingMoveDto.getStart_point_code());
|
param.put("device_code", blendingMoveDto.getStart_point_code());
|
||||||
param.put("material_code", "吨袋号");
|
param.put("material_code", object.getString("material_code"));
|
||||||
param.put("weight", "0");
|
param.put("weight", object.getString("weight"));
|
||||||
param.put("vehicle_code", blendingMoveDto.getVehicle_code());
|
param.put("vehicle_code", blendingMoveDto.getVehicle_code());
|
||||||
param.put("vehicle_type", GeneralDefinition.MATERIAL_CUP);
|
param.put("vehicle_type", GeneralDefinition.MATERIAL_CUP);
|
||||||
param.put("requestNo", IdUtil.simpleUUID());
|
param.put("requestNo", IdUtil.simpleUUID());
|
||||||
@@ -216,6 +221,10 @@ public class PdaServiceImpl implements PdaService {
|
|||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", "RGCDW01");
|
param.put("device_code", "RGCDW01");
|
||||||
param.put("config_code", "FJSKTask");
|
param.put("config_code", "FJSKTask");
|
||||||
|
// 获取载具类型和载具编码
|
||||||
|
SchBasePoint rgcdw01 = pointService.getById("RGCDW01");
|
||||||
|
param.put("vehicle_code", rgcdw01.getVehicle_code());
|
||||||
|
param.put("vehicle_type", GeneralDefinition.STEEL_TRAY);
|
||||||
taskService.apply(param);
|
taskService.apply(param);
|
||||||
return PdaResponseVo.pdaResultOk("空盘入库请求成功");
|
return PdaResponseVo.pdaResultOk("空盘入库请求成功");
|
||||||
}
|
}
|
||||||
@@ -282,7 +291,7 @@ public class PdaServiceImpl implements PdaService {
|
|||||||
// 准备参数:设备编码
|
// 准备参数:设备编码
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", "RGMDW01");
|
param.put("device_code", "RGMDW01");
|
||||||
param.put("config_code", "FJMLTask");
|
param.put("config_code", "RGFJRKTask");
|
||||||
param.put("qty", manualResidueInDto.getQty());
|
param.put("qty", manualResidueInDto.getQty());
|
||||||
param.put("vehicle_code", manualResidueInDto.getVehicle_code());
|
param.put("vehicle_code", manualResidueInDto.getVehicle_code());
|
||||||
param.put("vehicle_qty", "1");
|
param.put("vehicle_qty", "1");
|
||||||
@@ -292,7 +301,7 @@ public class PdaServiceImpl implements PdaService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TaskShowVo> packingTaskShow() {
|
public List<TaskShowVo> packingTaskShow() {
|
||||||
return pdaMapper.getRunningTaskByStart("RGMDW01", "FJMLTask");
|
return pdaMapper.getRunningTaskByStart("RGMDW01", "RGFJRKTask");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ public class FJMKTask extends AbstractTask {
|
|||||||
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
|
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
|
||||||
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
|
||||||
groupEntity.setIs_delete(false);
|
groupEntity.setIs_delete(false);
|
||||||
groupEntity.setIs_full(isFull.equals(GeneralDefinition.YES) ? true : false);
|
groupEntity.setIs_full(isFull.equals(GeneralDefinition.YES));
|
||||||
vehiclematerialgroupService.saveOrUpdate(groupEntity);
|
vehiclematerialgroupService.saveOrUpdate(groupEntity);
|
||||||
// 返回组盘id记录任务中
|
// 返回组盘id记录任务中
|
||||||
return groupEntity.getGroup_id();
|
return groupEntity.getGroup_id();
|
||||||
|
|||||||
@@ -232,8 +232,8 @@ public class FJQLTask extends AbstractTask {
|
|||||||
processTracking.setRecord_time(DateUtil.now());
|
processTracking.setRecord_time(DateUtil.now());
|
||||||
processTrackingService.create(processTracking);
|
processTrackingService.create(processTracking);
|
||||||
// 终点设置对应的参数
|
// 终点设置对应的参数
|
||||||
endPointObj.setVehicle_code(startPointObj.getVehicle_code());
|
endPointObj.setVehicle_code(vehicleMaterialGroupObj.getVehicle_code());
|
||||||
endPointObj.setVehicle_type(startPointObj.getVehicle_type());
|
endPointObj.setVehicle_type(vehicleMaterialGroupObj.getVehicle_type());
|
||||||
endPointObj.setPoint_status(PointStatusEnum.EMPTY_VEHICLE.getCode());
|
endPointObj.setPoint_status(PointStatusEnum.EMPTY_VEHICLE.getCode());
|
||||||
PointUtils.setUpdateByType(endPointObj, taskFinishedType);
|
PointUtils.setUpdateByType(endPointObj, taskFinishedType);
|
||||||
pointService.updateById(endPointObj);
|
pointService.updateById(endPointObj);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
AND p.point_status = '3'
|
AND p.point_status = '3'
|
||||||
AND vg.is_firing = true
|
AND vg.is_firing = true
|
||||||
AND vg.material_id = #{materialId}
|
AND vg.material_id = #{materialId}
|
||||||
AND TIMESTAMPDIFF(MINUTE, vg.instorage_time, NOW()) > ma.cooling_time
|
AND TIMESTAMPDIFF(MINUTE, vg.instorage_time, NOW()) >= ma.cooling_time
|
||||||
AND p.region_code IN
|
AND p.region_code IN
|
||||||
<foreach collection="regionCode" item="code" separator="," open="(" close=")">
|
<foreach collection="regionCode" item="code" separator="," open="(" close=")">
|
||||||
#{code}
|
#{code}
|
||||||
|
|||||||
@@ -193,7 +193,6 @@ public class HNMLTask extends AbstractTask {
|
|||||||
private SchBasePoint findNextPoint(List<String> nextRegionStr, JSONObject requestParam) {
|
private SchBasePoint findNextPoint(List<String> nextRegionStr, JSONObject requestParam) {
|
||||||
// *: 混碾无工单
|
// *: 混碾无工单
|
||||||
String materialCode = requestParam.getString("material_code"); // 混碾编码
|
String materialCode = requestParam.getString("material_code"); // 混碾编码
|
||||||
materialCode = "GBMAC3";
|
|
||||||
Assert.notNull(materialCode, "物料编码不能为空!");
|
Assert.notNull(materialCode, "物料编码不能为空!");
|
||||||
// 根据工单物料标识寻找点位
|
// 根据工单物料标识寻找点位
|
||||||
List<SchBasePoint> points = hnMapper.findPointForHNMLAndWorkOrder(nextRegionStr, materialCode);
|
List<SchBasePoint> points = hnMapper.findPointForHNMLAndWorkOrder(nextRegionStr, materialCode);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ spring:
|
|||||||
freemarker:
|
freemarker:
|
||||||
check-template-location: false
|
check-template-location: false
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: dev
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
data:
|
data:
|
||||||
|
|||||||
Reference in New Issue
Block a user