This commit is contained in:
2022-12-27 14:17:00 +08:00
parent faf23f1e10
commit 3e22e4d742

View File

@@ -419,11 +419,31 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject resp = new JSONObject();
String ext_order_id = whereJson.getString("ext_order_id");
WorkorderDto dto = workordeService.findById(Long.valueOf(ext_order_id));
dto.setOrder_status("3");
dto.setUpdate_time(DateUtil.now());
workordeService.update(dto);
resp.put("status", "200");
resp.put("message", "人工排产确认成功!");
return resp;
if (ObjectUtil.isEmpty(dto)) {
throw new BadRequestException("查询到工单为空!");
}
String device_code = whereJson.getString("device_code");
String material_code = whereJson.getString("material_code");
MaterialbaseDto materialbaseDto = materialbaseService.findByCode(material_code);
if (ObjectUtil.isEmpty(materialbaseDto)) {
throw new BadRequestException("物料编码不存在!");
}
String order_code = whereJson.getString("order_code");
if (StrUtil.equals(device_code, dto.getDevice_code()) &&
StrUtil.equals(material_code, materialbaseDto.getMaterial_code())
&& StrUtil.equals(order_code, dto.getWorkorder_code())
) {
dto.setOrder_status("3");
dto.setUpdate_time(DateUtil.now());
workordeService.update(dto);
resp.put("status", "200");
resp.put("message", "人工排产确认成功!");
return resp;
} else {
resp.put("status", "400");
resp.put("message", "人工排产确认失败,工单设备编码或物料编码或工单号与acs传来的不一致");
return resp;
}
}
}