|
@ -25,6 +25,7 @@ import org.nl.wms.ext.acs.service.dto.to.wms.*; |
|
|
import org.nl.wms.ext.mes.service.WmsToMesService; |
|
|
import org.nl.wms.ext.mes.service.WmsToMesService; |
|
|
import org.nl.wms.ext.mes.service.dto.CusterDo; |
|
|
import org.nl.wms.ext.mes.service.dto.CusterDo; |
|
|
import org.nl.wms.ext.mes.service.dto.MesMudConsumptionDto; |
|
|
import org.nl.wms.ext.mes.service.dto.MesMudConsumptionDto; |
|
|
|
|
|
import org.nl.wms.ext.mes.service.dto.SpreaderDto; |
|
|
import org.nl.wms.ext.mms.service.WmsToMmsService; |
|
|
import org.nl.wms.ext.mms.service.WmsToMmsService; |
|
|
import org.nl.wms.ext.record.service.ISysInteractRecordService; |
|
|
import org.nl.wms.ext.record.service.ISysInteractRecordService; |
|
|
import org.nl.wms.pdm.consumption.service.IPdmBdMudConsumptionService; |
|
|
import org.nl.wms.pdm.consumption.service.IPdmBdMudConsumptionService; |
|
@ -314,7 +315,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
return ApplyTaskResponse.responseOk(requestNo, "任务创建成功", handling); |
|
|
return ApplyTaskResponse.responseOk(requestNo, "任务创建成功", handling); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// todo: 特殊处理
|
|
|
// mark: 特殊处理
|
|
|
protected int specialHandling(String regionCode, JSONObject param) { |
|
|
protected int specialHandling(String regionCode, JSONObject param) { |
|
|
int torus = 0; // 无业务:0,分拣剩余0托:1
|
|
|
int torus = 0; // 无业务:0,分拣剩余0托:1
|
|
|
if (regionCode.equals("FJ")) { // 判断是否够码满
|
|
|
if (regionCode.equals("FJ")) { // 判断是否够码满
|
|
@ -362,7 +363,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 任务:申请强制满托入缓存 todo: 暂时=分拣剩料回库 |
|
|
* 任务:申请强制满托入缓存 mark: 暂时=分拣剩料回库 |
|
|
* |
|
|
* |
|
|
* @param param: ApplyTaskRequest的json形式 |
|
|
* @param param: ApplyTaskRequest的json形式 |
|
|
* @return |
|
|
* @return |
|
@ -570,7 +571,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
workorderService.updateById(bdWorkorder); |
|
|
workorderService.updateById(bdWorkorder); |
|
|
log.info("工单完成: {}", bdWorkorder); |
|
|
log.info("工单完成: {}", bdWorkorder); |
|
|
try { |
|
|
try { |
|
|
// todo: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes
|
|
|
// mark: 统计当前设备的不合格位置的数量作为不合格数,并上报给mes
|
|
|
wmsToMesService.reportPressUnusedMaterial(bdWorkorder); |
|
|
wmsToMesService.reportPressUnusedMaterial(bdWorkorder); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
log.info("调用mes异常:{}", e.getMessage()); |
|
|
log.info("调用mes异常:{}", e.getMessage()); |
|
@ -613,7 +614,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 扫码成功申请 - 判断是否静置完成 |
|
|
* 扫码成功申请 - 判断是否静置完成 |
|
|
* todo: 需要返回泥料重量 |
|
|
* mark: 需要返回泥料重量 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public ApplyTaskResponse isStandingFinish(ApplyTaskRequest baseRequest) { |
|
|
public ApplyTaskResponse isStandingFinish(ApplyTaskRequest baseRequest) { |
|
@ -683,6 +684,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
taskResponse.setIs_standing_finish(GeneralDefinition.YES); |
|
|
taskResponse.setIs_standing_finish(GeneralDefinition.YES); |
|
|
taskResponse.setMessage("静置完成"); |
|
|
taskResponse.setMessage("静置完成"); |
|
|
taskResponse.setWeight(one.getMaterial_weight().toString()); |
|
|
taskResponse.setWeight(one.getMaterial_weight().toString()); |
|
|
|
|
|
taskResponse.setMudBatch(one.getPcsn()); |
|
|
// 泥料数据删除
|
|
|
// 泥料数据删除
|
|
|
List<PdmBdRequestMaterialRecord> list = requestMaterialRecordService.list(new LambdaQueryWrapper<PdmBdRequestMaterialRecord>() |
|
|
List<PdmBdRequestMaterialRecord> list = requestMaterialRecordService.list(new LambdaQueryWrapper<PdmBdRequestMaterialRecord>() |
|
|
.eq(PdmBdRequestMaterialRecord::getDevice_code, productionTask.getPoint_code()) |
|
|
.eq(PdmBdRequestMaterialRecord::getDevice_code, productionTask.getPoint_code()) |
|
@ -716,16 +718,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
throw new BadRequestException("载具编码不能为空"); |
|
|
throw new BadRequestException("载具编码不能为空"); |
|
|
} |
|
|
} |
|
|
baseRequest.setVehicle_code(TaskUtils.defaultVehicleCode(baseRequest.getVehicle_code())); |
|
|
baseRequest.setVehicle_code(TaskUtils.defaultVehicleCode(baseRequest.getVehicle_code())); |
|
|
if (ObjectUtil.isEmpty(baseRequest.getVehicle_type())) { |
|
|
|
|
|
baseRequest.setVehicle_type(GeneralDefinition.STEEL_TRAY); |
|
|
baseRequest.setVehicle_type(GeneralDefinition.STEEL_TRAY); |
|
|
} |
|
|
|
|
|
SchBasePoint basePoint = pointService.getById(baseRequest.getDevice_code()); |
|
|
SchBasePoint basePoint = pointService.getById(baseRequest.getDevice_code()); |
|
|
// 入窑记录时间
|
|
|
// 入窑记录时间
|
|
|
SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(baseRequest.getVehicle_code(), |
|
|
SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(baseRequest.getVehicle_code(), |
|
|
baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue()); |
|
|
baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue()); |
|
|
if (ObjectUtil.isNotEmpty(groupInfo.getInto_kiln_time())) { |
|
|
if (ObjectUtil.isEmpty(groupInfo)) { |
|
|
// 如果已经记录就跳过
|
|
|
throw new BadRequestException("入窑失败:载具["+baseRequest.getVehicle_code()+"]组盘信息不存在!"); |
|
|
return ApplyTaskResponse.responseOk(baseRequest.getRequestNo()); |
|
|
|
|
|
} |
|
|
} |
|
|
groupInfo.setInto_kiln_time(DateUtil.now()); |
|
|
groupInfo.setInto_kiln_time(DateUtil.now()); |
|
|
if (ObjectUtil.isNotEmpty(basePoint)) { |
|
|
if (ObjectUtil.isNotEmpty(basePoint)) { |
|
@ -772,7 +771,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
if (ObjectUtil.isEmpty(deviceProductionTask)) { |
|
|
if (ObjectUtil.isEmpty(deviceProductionTask)) { |
|
|
throw new BadRequestException("压机" + deviceCode + "暂无生产的工单"); |
|
|
throw new BadRequestException("压机" + deviceCode + "暂无生产的工单"); |
|
|
} |
|
|
} |
|
|
// todo: 2、通知混碾机生产泥料 - 直接存入混碾系统的数据库中
|
|
|
// mark: 2、通知混碾机生产泥料 - 直接存入混碾系统的数据库中
|
|
|
try { |
|
|
try { |
|
|
wmsToMmsService.addRequestMaterial(deviceProductionTask); |
|
|
wmsToMmsService.addRequestMaterial(deviceProductionTask); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
@ -951,4 +950,31 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
} |
|
|
} |
|
|
return BaseResponse.responseOk(actionRequest.getRequestNo()); |
|
|
return BaseResponse.responseOk(actionRequest.getRequestNo()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public BaseResponse applyOneCloth(JSONObject param) { |
|
|
|
|
|
// mark: 上传mes数据
|
|
|
|
|
|
ClothRequest actionRequest = param.toJavaObject(ClothRequest.class); |
|
|
|
|
|
// 获取工单
|
|
|
|
|
|
PdmBdWorkorder productionTask = workorderService.getDeviceDockingProductionTask(actionRequest.getDevice_code()); |
|
|
|
|
|
MdBaseMaterial mdBaseMaterial = materialService.getById(productionTask.getMaterial_id()); |
|
|
|
|
|
SpreaderDto spreaderDto = new SpreaderDto(); |
|
|
|
|
|
spreaderDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
|
|
|
spreaderDto.setTIM(DateUtil.now()); |
|
|
|
|
|
BigDecimal bigDecimalValue = new BigDecimal(ObjectUtil.isEmpty(actionRequest.getWeight()) |
|
|
|
|
|
? "0" : actionRequest.getWeight()); |
|
|
|
|
|
spreaderDto.setACT_WEIGHT(bigDecimalValue); |
|
|
|
|
|
BigDecimal bigDecimal = new BigDecimal(ObjectUtil.isEmpty(actionRequest.getSet_weight()) |
|
|
|
|
|
? "0" : actionRequest.getSet_weight()); |
|
|
|
|
|
spreaderDto.setTHEO_WEIGHT(bigDecimal); |
|
|
|
|
|
spreaderDto.setMATERIAL_ID(mdBaseMaterial.getMaterial_id()); |
|
|
|
|
|
spreaderDto.setMATERIAL_NAME(mdBaseMaterial.getMaterial_name()); |
|
|
|
|
|
spreaderDto.setMATERIAL_SPEC(mdBaseMaterial.getMaterial_spec()); |
|
|
|
|
|
spreaderDto.setMATERIAL_MODEL(mdBaseMaterial.getMaterial_model()); |
|
|
|
|
|
spreaderDto.setFPROBATCH(actionRequest.getSlip()); |
|
|
|
|
|
spreaderDto.setCREATE_TM(DateUtil.now()); |
|
|
|
|
|
spreaderDto.setOP_FLAG(GeneralDefinition.NO); |
|
|
|
|
|
wmsToMesService.reportSpreaderInfoToMes(spreaderDto); |
|
|
|
|
|
return BaseResponse.responseOk(actionRequest.getRequestNo()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|